diff --git a/lib/eva/client/remote_controller.py b/lib/eva/client/remote_controller.py index 163cf095..c4de9d87 100644 --- a/lib/eva/client/remote_controller.py +++ b/lib/eva/client/remote_controller.py @@ -311,8 +311,10 @@ def set_mqtt_notifier(self): params = self.mqtt_update.split(':') n = params[0] notifier = eva.notify.get_notifier(n) - if not notifier or notifier.notifier_type != 'mqtt': - logging.error('%s: invalid mqtt notifier %s' % \ + if not notifier or notifier.notifier_type not in [ + 'mqtt', 'psrt' + ]: + logging.error('%s: invalid mqtt/psrt notifier %s' % \ (self.oid, n)) else: self.mqtt_notifier = notifier diff --git a/lib/eva/item.py b/lib/eva/item.py index 1abe294d..93b70217 100644 --- a/lib/eva/item.py +++ b/lib/eva/item.py @@ -373,7 +373,7 @@ def update_config(self, data): params = data['mqtt_update'].split(':') n = params[0] notifier = eva.notify.get_notifier(n) - if not notifier or notifier.notifier_type != 'mqtt': + if not notifier or notifier.notifier_type not in ['mqtt', 'psrt']: logging.error('%s: invalid mqtt notifier %s' % \ (self.oid, n)) else: @@ -481,7 +481,9 @@ def set_prop(self, prop, val=None, save=False): n = params[0] import eva.notify notifier = eva.notify.get_notifier(n) - if not notifier or notifier.notifier_type != 'mqtt': + if not notifier or notifier.notifier_type not in [ + 'mqtt', 'psrt' + ]: return False if len(params) > 1: try: @@ -523,7 +525,7 @@ def subscribe_mqtt_update(self): not self._mqtt_updates_allowed: return False notifier = eva.notify.get_notifier(self.mqtt_update_notifier) - if not notifier or notifier.notifier_type[:4] != 'mqtt': + if not notifier or notifier.notifier_type[:4] not in ['mqtt', 'psrt']: return False try: notifier.update_item_append(self) @@ -538,7 +540,7 @@ def unsubscribe_mqtt_update(self): not self._mqtt_updates_allowed: return False notifier = eva.notify.get_notifier(self.mqtt_update_notifier) - if not notifier or notifier.notifier_type[:4] != 'mqtt': + if not notifier or notifier.notifier_type[:4] not in ['mqtt', 'psrt']: return False try: notifier.update_item_remove(self) @@ -990,7 +992,7 @@ def subscribe_mqtt_control(self): if not self.mqtt_control: return False notifier = eva.notify.get_notifier(self.mqtt_control_notifier) - if not notifier or notifier.notifier_type[:4] != 'mqtt': + if not notifier or notifier.notifier_type[:4] not in ['mqtt', 'psrt']: return False try: notifier.control_item_append(self) @@ -1003,7 +1005,7 @@ def unsubscribe_mqtt_control(self): if not self.mqtt_control: return False notifier = eva.notify.get_notifier(self.mqtt_control_notifier) - if not notifier or notifier.notifier_type[:4] != 'mqtt': + if not notifier or notifier.notifier_type[:4] not in ['mqtt', 'psrt']: return False try: notifier.control_item_remove(self) @@ -1186,7 +1188,9 @@ def set_prop(self, prop, val=None, save=False): n = params[0] import eva.notify notifier = eva.notify.get_notifier(n) - if not notifier or notifier.notifier_type != 'mqtt': + if not notifier or notifier.notifier_type not in [ + 'mqtt', 'psrt' + ]: return False if len(params) > 1: try: