From e8c0e4fedeb01acd6200128e2fdacddcc0dd7048 Mon Sep 17 00:00:00 2001 From: miro Date: Wed, 29 May 2024 21:41:42 +0100 Subject: [PATCH] disable "when" intent, api has been deprecated fix some typos --- __init__.py | 31 ++++++++++++++++++++++++------- setup.py | 2 +- translations/en-us/intents.json | 10 ++++++++-- translations/pt-pt/vocabs.json | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/__init__.py b/__init__.py index 5a89ab9..963bf56 100644 --- a/__init__.py +++ b/__init__.py @@ -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: @@ -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"] @@ -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( @@ -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( @@ -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. diff --git a/setup.py b/setup.py index 0332316..7a20026 100644 --- a/setup.py +++ b/setup.py @@ -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 = "jarbasai@mailfence.com" diff --git a/translations/en-us/intents.json b/translations/en-us/intents.json index 27f4854..4cdd031 100644 --- a/translations/en-us/intents.json +++ b/translations/en-us/intents.json @@ -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" diff --git a/translations/pt-pt/vocabs.json b/translations/pt-pt/vocabs.json index 02eeb85..b1af9ee 100644 --- a/translations/pt-pt/vocabs.json +++ b/translations/pt-pt/vocabs.json @@ -22,4 +22,4 @@ "estação Espacial", "estação Espacial Internacional" ] -} +} \ No newline at end of file