Correct zwave_js value changed callback signature (#45110)

pull/45114/head
Martin Hjelmare 2021-01-13 15:31:31 +01:00 committed by GitHub
parent 938d8be0c8
commit 3537a7c3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -1091,7 +1091,6 @@ omit =
homeassistant/components/supla/*
homeassistant/components/zwave/util.py
homeassistant/components/zwave_js/discovery.py
homeassistant/components/zwave_js/entity.py
homeassistant/components/zwave_js/light.py
homeassistant/components/zwave_js/sensor.py

View File

@ -83,15 +83,12 @@ class ZWaveBaseEntity(Entity):
return self.client.connected and bool(self.info.node.ready)
@callback
def _value_changed(self, event_data: Union[dict, ZwaveValue]) -> None:
def _value_changed(self, event_data: dict) -> None:
"""Call when (one of) our watched values changes.
Should not be overridden by subclasses.
"""
if isinstance(event_data, ZwaveValue):
value_id = event_data.value_id
else:
value_id = event_data["value"].value_id
value_id = event_data["value"].value_id
if value_id not in self.watched_value_ids:
return