Fix all off functionality

This commit is contained in:
Dirk Alders 2025-08-26 19:05:29 +02:00
parent 78dde64e92
commit 5d44e0e68d

View File

@ -44,8 +44,11 @@ class room_collection(object):
# attribute name is not private # attribute name is not private
if not sub_name.startswith("__"): if not sub_name.startswith("__"):
sub = getattr(self, sub_name) sub = getattr(self, sub_name)
if sub.__class__.__bases__[0].__name__ in self.ALLOWED_CLASSES: # try to call all_off
try:
sub.all_off() sub.all_off()
except AttributeError:
pass # don't mind, if sub has no method all_off
def summer_mode(self, device=None, key=None, data=None): def summer_mode(self, device=None, key=None, data=None):
logger.info("Changing to %s \"%s\"", "summer mode" if data else "winter_mode", type(self).__name__) logger.info("Changing to %s \"%s\"", "summer mode" if data else "winter_mode", type(self).__name__)