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

Use compressed entity changes for device controls #2942

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

jpelgrom
Copy link
Member

@jpelgrom jpelgrom commented Oct 2, 2022

Summary

This PR adds support for the subscribe_entities websocket subscription which delivers state + changes in a compressed format to reduce data usage, supposedly by 35-90% depending on the message.

Device controls have been updated to use the new subscription on supported Home Assistant versions.

Because subscribe_entities combines initial states + state changes in a single subscription, it is not a drop-in replacement for existing entity state changes subscribers, as those only deliver changes. Because the app re-uses subscriptions with the same request message users also have to be mindful of potential re-use, as they may not get the initial states if they are not the first subscriber.

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

Testing note: I don't think the limitations mentioned in the last paragraph above apply here; the code has been updated to handle initial states and changes in one subscription, and there should only be one subscription active at a time. During testing I was only able to get it to stop working once, but that was before the recent changes to subscriptions that use a Channel to buffer messages. Still, please do try getting it into weird states!

 - Add support for the subscribe_entities websocket subscription which delivers initial state + changes in a compressed format to reduce data usage
 - Use the new subscribe_entities format in device controls on supported Home Assistant versions
@jpelgrom jpelgrom force-pushed the websocket-subscribe-entities branch from c122f37 to 6a5301c Compare October 2, 2022 11:30
@JBassett JBassett merged commit dd800d0 into home-assistant:master Oct 19, 2022
@jpelgrom jpelgrom deleted the websocket-subscribe-entities branch October 19, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants