fix inverse state changes for binary sensors (#22479)
This commit is contained in:
parent
26d4736ebf
commit
d13c892b28
2 changed files with 2 additions and 2 deletions
|
@ -429,7 +429,7 @@ class KonnectedView(HomeAssistantView):
|
|||
|
||||
if not pin:
|
||||
return self.json_message(
|
||||
'Switch on pin ' + pin_num + ' not configured',
|
||||
format('Switch on pin {} not configured', pin_num),
|
||||
status_code=HTTP_NOT_FOUND)
|
||||
|
||||
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)
|
||||
entity_id = context.get(ATTR_ENTITY_ID)
|
||||
state = bool(int(msg.get(ATTR_STATE)))
|
||||
if msg.get(CONF_INVERSE):
|
||||
if context.get(CONF_INVERSE):
|
||||
state = not state
|
||||
|
||||
async_dispatcher_send(
|
||||
|
|
Loading…
Add table
Reference in a new issue