diff --git a/homeassistant/components/konnected/__init__.py b/homeassistant/components/konnected/__init__.py index 3a2dc3b2417ab0..276e395817c0d5 100644 --- a/homeassistant/components/konnected/__init__.py +++ b/homeassistant/components/konnected/__init__.py @@ -429,7 +429,7 @@ async def get(self, request: Request, device_id) -> Response: 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( diff --git a/homeassistant/components/konnected/handlers.py b/homeassistant/components/konnected/handlers.py index 6e92e7f20c8615..bd93ee80e21cf5 100644 --- a/homeassistant/components/konnected/handlers.py +++ b/homeassistant/components/konnected/handlers.py @@ -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(