-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Refactor coordinator #178
Comments
I have found a way to request continuous status updates from the CX3550/01 fan and thought I'd share my findings here: The only way to get status updates seems to be to send commands to the fan. We can use this to send the command to reduce the beeper volume to 0 every few seconds. This way we don't get annoyed by the constant beeping by the status request commands being sent, but get notified even when the fan is manipulated by directly pressing buttons. I have tried this out in a sample python project and it works great. I think this should be included as an optional mechanism to poll status updates in the coordinator for entities that define such a command. For devices that do not have such a command, the state has to be assumed. This can be done by modifying the local copy of the device state every time a command is invoked by Home Assistant. When a status update is received, the dictionary then gets updated with the actual state. |
You mean introducing a setting to poll status for people who don't get automatic push updates? I lack that experience as so my devices push updates so the time. As to your second point: I noticed in your code that you did this already for the fan entity and I've copied this over for all other entities as well in the refactoring. |
This is also one reason why the refactoring right now requires to setup all devices fresh. Note to self: I need to implement an automatic upgrade path. |
The CX3550/01 does not send any status updates on its own, and the If you want I could implement this and open a PR towards the branch you are working on refactoring the coordinator. |
We could make that a config option |
Btw, I moved back from my fork to this repo and the new coordinator seems to work great with the CX3550/01 fan. Thanks! |
Ideally, there is a config option setting that allows the integration to be reconfigured from the UI with a polling interval for this. Let's create a new issue for that idea. Would you still be happy to provide a PR? |
Inspired by the work of @EuleMitKeule the
coordinator
should be refactored from thephilips.py
fileThe text was updated successfully, but these errors were encountered: