We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54b1e89 commit 1ddf19dCopy full SHA for 1ddf19d
custom_components/pyscript/__init__.py
@@ -232,7 +232,7 @@ async def state_changed(event):
232
233
for attribute in event.data["new_state"].attributes:
234
new_val = event.data["new_state"].attributes[attribute]
235
- if "old_state" in event.data and attribute in event.data["old_state"].attributes:
+ if "old_state" in event.data and event.data['old_state'] is not None and attribute in event.data["old_state"].attributes:
236
old_val = event.data["old_state"].attributes[attribute]
237
else:
238
old_val = None
0 commit comments