-
Notifications
You must be signed in to change notification settings - Fork 99
Fix setting display state when light detection is turned on #351
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
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
This solves a login failure that I think is worthy of a release so we can continue testing with users. |
I'm thinking that it should be avoided to set two states in a single method. The |
Good point. It does cause an issue with HA since it doesn't have an entity for light detection, so when it's enabled the HA display control just doesn't work. |
You could always look at the |
That general issue is something that has been on my mind. Right now if an action fails HA does display it but doesn't provide the reason to the user. Ideally in HA when we throw the exception we would pass the text result. Sounds like we can do that in HA based on last response text. |
I reverted the automatic call to |
5fb1fea
to
d962e65
Compare
Thank you! |
When light detection is turned on, it controls the display status.
If trying to set the display status while light detection is on, the API responds with error "11017000 (BYPASS_NOT_SUPPORTED)".
As a fix, the
toggle_display
method now checks the light detection status and turns it off if necessary before setting the display status.Testing (on Levoit Vital 100S) has shown that there is a small delay when disabling light detection before the display can be set - I added a 1 second delay in that case which was enough time in my case.
I included another small change regarding the login methods that I missed in #348 which fixes a cross-region error being thrown even though login was successful.