Fix: all_off

This commit is contained in:
Dirk Alders 2025-08-30 17:09:18 +02:00
parent 6f57eebee5
commit 991eeeb2d6

View File

@ -169,13 +169,15 @@ class all_off(videv_base):
mqtt_client.add_callback(all_off_topic, self.all_off) mqtt_client.add_callback(all_off_topic, self.all_off)
def __check_inst_capabilities__(self, name, inst): def __check_inst_capabilities__(self, name, inst):
# fits to specified classes if hasattr(inst, "ADD_TO_VIDEV_ALL_OFF"):
try: # fits to specified classes
# all_off method is callable try:
return callable(inst.all_off) # all_off method is callable
except AttributeError: return callable(inst.all_off)
# all_off method does not exist except AttributeError:
return False # all_off method does not exist
return False
return False
def __add_instances__(self, name, inst, level=0): def __add_instances__(self, name, inst, level=0):
if self.__check_inst_capabilities__(name, inst): if self.__check_inst_capabilities__(name, inst):