mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
fix inverse state changes for binary sensors (#22479)
This commit is contained in:
parent
26d4736ebf
commit
d13c892b28
@ -429,7 +429,7 @@ class KonnectedView(HomeAssistantView):
|
|||||||
|
|
||||||
if not pin:
|
if not pin:
|
||||||
return self.json_message(
|
return self.json_message(
|
||||||
'Switch on pin ' + pin_num + ' not configured',
|
format('Switch on pin {} not configured', pin_num),
|
||||||
status_code=HTTP_NOT_FOUND)
|
status_code=HTTP_NOT_FOUND)
|
||||||
|
|
||||||
return self.json(
|
return self.json(
|
||||||
|
@ -19,7 +19,7 @@ async def async_handle_state_update(hass, context, msg):
|
|||||||
_LOGGER.debug("[state handler] context: %s msg: %s", context, msg)
|
_LOGGER.debug("[state handler] context: %s msg: %s", context, msg)
|
||||||
entity_id = context.get(ATTR_ENTITY_ID)
|
entity_id = context.get(ATTR_ENTITY_ID)
|
||||||
state = bool(int(msg.get(ATTR_STATE)))
|
state = bool(int(msg.get(ATTR_STATE)))
|
||||||
if msg.get(CONF_INVERSE):
|
if context.get(CONF_INVERSE):
|
||||||
state = not state
|
state = not state
|
||||||
|
|
||||||
async_dispatcher_send(
|
async_dispatcher_send(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user