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 foundpull/12057/head
parent
8624799c45
commit
5b1c51bdf6
|
@ -94,6 +94,11 @@ class MqttBinarySensor(MqttAvailability, BinarySensorDevice):
|
|||
self._state = True
|
||||
elif payload == self._payload_off:
|
||||
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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue