Skip to content

Commit 00de489

Browse files
committed
properly determine all attributes
1 parent 3228934 commit 00de489

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

custom_components/pyscript/trigger.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,8 @@ async def trigger_watch(self):
834834
catch_all_entity = f"{func_args['var_name']}.*"
835835
if catch_all_entity in self.state_trig_ident_any:
836836
# catch all has been requested, check all attributes for change
837-
for attribute in func_args['value'].__dict__:
838-
if attribute in ['last_updated', 'last_changed']:
839-
continue
837+
all_attributes = (set(func_args['value'].__dict__.keys()) | set(func_args['old_value'].__dict__.keys())) - {"last_updated", "last_changed"}
838+
for attribute in all_attributes:
840839
attrib_val = getattr(func_args['value'], attribute, None)
841840
attrib_old_val = getattr(func_args['old_value'], attribute, None)
842841
if attrib_old_val != attrib_val:

0 commit comments

Comments
 (0)