diff --git a/neon_iris/client.py b/neon_iris/client.py index 62f8db7..2faa7c1 100644 --- a/neon_iris/client.py +++ b/neon_iris/client.py @@ -179,6 +179,8 @@ def handle_neon_response(self, channel, method, _, body): self.handle_error_response(message) elif message.msg_type == "neon.languages.get.response": self._handle_supported_languages(message) + elif message.msg_type == "neon.alert_expired": + self.handle_alert(message) elif message.msg_type.endswith(".response"): self.handle_api_response(message) else: @@ -231,6 +233,12 @@ def clear_media(self, message: Message): Override this method to handle requests to clear media (photos, etc) """ + @abstractmethod + def handle_alert(self, message: Message): + """ + Override this method to handle alerts (timers, alarms, reminders) + """ + def _handle_profile_update(self, message: Message): updated_profile = message.data["profile"] if updated_profile['user']['username'] == \ @@ -469,6 +477,9 @@ def handle_api_response(self, message: Message): def clear_caches(self, message: Message): print("Cached Responses Cleared") + def handle_alert(self, message: Message): + print(f"\nAlert Expired: {message.data.get('alert_name')}") + def clear_media(self, message: Message): pass