unfoldedcircle/integration-home-assistant

After initial setup on remote integration remains in disconnected state

zehnm opened this issue · 0 comments

zehnm commented

A fresh setup on the remote (e.g. after a factory reset) leaves the integration in DISCONNECTED state. At least from the remote's view.
However, the integration is not showing any connection issue and is communicating with HA.
Sending connect events (either through web-configurator, or manually with the Core-API) has no effect, since the internal state is already CONNECTED. There's also no device_state event sent back:

R2Event::Connect => {
if self.device_state != DeviceState::Connected {
ctx.notify(ConnectMsg::default());
}
}

After sleep & wakeup, the state is synchronized and the integration is working. Same happens after a reboot.

Discovered while testing unfoldedcircle/feature-and-bug-tracker/issues/237 after user reports of having to reboot the remote.

Required fixes:

  • Always send the device_state event back after receiving the connect event.
  • Make sure the device state is sent back after setup (might be already the case with the above fix).