Adapted all_off videv device for usage inside devdi
This commit is contained in:
parent
abfbf2496a
commit
c75c0cfacd
10
videv.py
10
videv.py
@ -156,17 +156,19 @@ class videv_audio_player(videv_base):
|
||||
self.__tx__(self.KEY_TITLE, data or self.NO_TITLE)
|
||||
|
||||
|
||||
class all_off(videv_base):
|
||||
def __init__(self, mqtt_client, topic, room_collection):
|
||||
class videv_all_off(videv_base):
|
||||
def __init__(self, mqtt_client, topic):
|
||||
super().__init__(mqtt_client, topic)
|
||||
# init __inst_dict__
|
||||
self.__inst_dict__ = {}
|
||||
|
||||
def connect_room_collection(self, room_collection):
|
||||
self.__add_instances__("all", room_collection)
|
||||
# register mqtt callbacks for all my keys
|
||||
for key in self.__inst_dict__:
|
||||
all_off_topic = "/".join([topic, key])
|
||||
all_off_topic = "/".join([self.topic, key])
|
||||
logger.info("Addin all_off callback with topic %s", repr(all_off_topic))
|
||||
mqtt_client.add_callback(all_off_topic, self.rx_all_off)
|
||||
self.mqtt_client.add_callback(all_off_topic, self.rx_all_off)
|
||||
|
||||
def __check_inst_capabilities__(self, name, inst):
|
||||
if hasattr(inst, "ADD_TO_VIDEV_ALL_OFF"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user