Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disconnect from HA when device enters standby #50

Closed
zehnm opened this issue Feb 13, 2024 · 0 comments · Fixed by #51
Closed

Option to disconnect from HA when device enters standby #50

zehnm opened this issue Feb 13, 2024 · 0 comments · Fixed by #51
Assignees
Labels
enhancement New feature or request

Comments

@zehnm
Copy link
Contributor

zehnm commented Feb 13, 2024

When running on the Remote Two device, the WebSocket connection to the HA server is currently kept open when the device enters suspend mode.

The Remote Two sends the enter_standby and exit_standby events, but they aren't being used yet in the integration besides setting a flag:

R2Event::EnterStandby => {
session.standby = true;
}
R2Event::ExitStandby => {
session.standby = false;
// TODO send updates #5
}

In certain environments this works quite well and the HA connection is immediately available after WiFi is connected. However, this can also cause connectivity issues after the device wakes up and take longer to detect a no longer working WebSocket connection.

With the upcoming, renewed connection logic in the core (unfoldedcircle/feature-and-bug-tracker#320) the integration should disconnect from HA when entering standby, and immediatly reconnect when receiving the exit_standby event.

This might also help with the following HA server log entries: Client unable to keep up with pending messages (unfoldedcircle/feature-and-bug-tracker#301). Assumption: remote is in standby and HA tries to send entity change events over the still open WebSocket connection.

@zehnm zehnm added the enhancement New feature or request label Feb 13, 2024
@zehnm zehnm self-assigned this Feb 13, 2024
zehnm added a commit that referenced this issue Feb 13, 2024
New option to disconnect from HA server when the device enters standby
and immediately reconnects when leaving standby (enabled by default).
This is controlled by the `enter_standby` and `exit_standby` events from
Remote Two.

Closes #50
@zehnm zehnm closed this as completed in #51 Feb 16, 2024
zehnm added a commit that referenced this issue Feb 16, 2024
New option to disconnect from HA server when the device enters standby
and immediately reconnects when leaving standby (enabled by default).
This is controlled by the `enter_standby` and `exit_standby` events from
Remote Two.

Closes #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant