Skip to content

Commit

Permalink
disable "when" intent, api has been deprecated
Browse files Browse the repository at this point in the history
fix some typos
  • Loading branch information
JarbasAl committed May 29, 2024
1 parent 749e19a commit e8c0e4f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
31 changes: 24 additions & 7 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def update_picture(self):
self.gui['imgLink'] = image
self.gui['caption'] = f"{toponym} Lat: {lat} Lon: {lon}"
self.gui['lat'] = lat
self.gui['lot'] = lon
self.gui['lon'] = lon
self.gui['toponym'] = toponym
self.gui["astronauts"] = astronauts["people"]
self.set_context("iss")
except Exception as e:
Expand Down Expand Up @@ -154,9 +155,10 @@ def handle_iss(self, message):
"toponym": self.gui['toponym']
}, wait=True)
sleep(1)
self.gui.clear()
self.gui.release()

@intent_handler('when_iss.intent')
# TODO - api has been deprecated, find replacement
#@intent_handler('when_iss.intent')
def handle_when(self, message):
lat = self.location["coordinate"]["latitude"]
lon = self.location["coordinate"]["longitude"]
Expand All @@ -180,7 +182,7 @@ def handle_when(self, message):
"toponym": self.location_pretty
}, wait=True)
sleep(1)
self.gui.clear()
self.gui.release()

@intent_handler(
IntentBuilder("WhoISSIntent").require("who").require(
Expand All @@ -198,7 +200,7 @@ def handle_who(self, message):
caption=people)
self.speak_dialog("who", {"people": people}, wait=True)
sleep(1)
self.gui.clear()
self.gui.release()

@intent_handler(
IntentBuilder("NumberISSIntent").require("how_many").require(
Expand All @@ -217,11 +219,26 @@ def handle_number(self, message):
caption=people)
self.speak_dialog("number", {"number": num}, wait=True)
sleep(1)
self.gui.clear()
self.gui.release()


if __name__ == "__main__":
from ovos_utils.fakebus import FakeBus
from ovos_bus_client.message import Message

# print speak for debugging
def spk(utt, *args, **kwargs):
print(utt)

s = ISSLocationSkill(skill_id="fake.test", bus=FakeBus())
s.update_picture()
# s.update_picture()
s.speak = spk

s.handle_number(Message(""))
# there are 7 persons on board of the international space station
s.handle_who(Message(""))
# Jasmin Moghbeli, Andreas Mogensen, Satoshi Furukawa, Konstantin Borisov, Oleg Kononenko, Nikolai Chub, Loral O'Hara are in orbit on board of the space station
s.handle_iss(Message(""))
# The international space station is now over Central African Republic at 8.6270 latitude 21.5912 longitude
s.handle_about_iss_intent(Message(""))
# The International Space Station is a modular space station in low Earth orbit. The ISS programme is a multi-national collaborative project between five participating space agencies: NASA ( United States ) , Roscosmos ( Russia ) , JAXA ( Japan ) , ESA ( Europe ) , and CSA ( Canada ) .The ownership and use of the space station is established by intergovernmental treaties and agreements.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Define package information
SKILL_CLAZZ = "ISSLocationSkill" # Make sure it matches __init__.py class name
VERSION = "0.1.0a2"
VERSION = "0.1.0a3"
URL = "https://github.com/OpenVoiceOS/ovos-skill-iss-location"
AUTHOR = "OpenVoiceOS"
EMAIL = "[email protected]"
Expand Down
10 changes: 8 additions & 2 deletions translations/en-us/intents.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"when_iss.intent": [
"when is the (international|) space station passing (by|over|above) (us|me|)"
"when is the (international|) space station passing (by|over|above) (us|me|)",
"when is the (ISS|I S S) passing (by|over|above) (us|me|)",
"when is the (international|) space station going to be (over|above) (us|me|)",
"when is the (ISS|I S S) going to be (over|above) (us|me|)"
],
"where_iss.intent": [
"where is the (international|) space station",
"(what is|tell me) the (international|) space station location",
"location of the (international|) space station"
"location of the (international|) space station",
"where is the (ISS|I S S)",
"(what is|tell me) the (ISS|I S S) location",
"location of the (ISS|I S S)"
],
"about.intent": [
"(talk about|tell me about|what is|info about) the (international|) space station"
Expand Down
2 changes: 1 addition & 1 deletion translations/pt-pt/vocabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"estação Espacial",
"estação Espacial Internacional"
]
}
}

0 comments on commit e8c0e4f

Please sign in to comment.