Handling of payload not for this entity. (#11836)
* Handling of payload not for this entity. The update state-method should not be called if the payload is not intended for this entity. * Fixing linter errors * Adding warning for case when no matching payload is found
This commit is contained in:
parent
8624799c45
commit
5b1c51bdf6
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ class MqttBinarySensor(MqttAvailability, BinarySensorDevice):
|
||||||
self._state = True
|
self._state = True
|
||||||
elif payload == self._payload_off:
|
elif payload == self._payload_off:
|
||||||
self._state = False
|
self._state = False
|
||||||
|
else: # Payload is not for this entity
|
||||||
|
_LOGGER.warning('No matching payload found'
|
||||||
|
' for entity: %s with state_topic: %s',
|
||||||
|
self._name, self._state_topic)
|
||||||
|
return
|
||||||
|
|
||||||
self.async_schedule_update_ha_state()
|
self.async_schedule_update_ha_state()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue