Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-wong committed May 14, 2022
1 parent 86efd8f commit 7d95f2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/bemfa/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def disconnect(self) -> None:
self._mqttc.disconnect()

def _state_listener(self, event):
entity_id = event.data.get("new_state").entity_id
new_state = event.data.get("new_state")
if new_state is None:
return
entity_id = new_state.entity_id
if entity_id not in self._topic_to_entity_id.values():
return
topic = (list(self._topic_to_entity_id.keys()))[
Expand Down

0 comments on commit 7d95f2f

Please sign in to comment.