-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
Add ability for ClimateControl Card to cycle through entity states #4142
Add ability for ClimateControl Card to cycle through entity states #4142
Conversation
Do you actually have an example of this working? I've seen this option in the documentation before but couldn't get it to cycle/do anything with multiple modes, and your video also doesn't show anything except off/heat. If anything, it shows it not working (0:07 tap and nothing happens, needs another tap at 0:10). |
I'm not sure about the additional tap (it was definitely necessary in this case). Probably cause the service didn't return yet or something. Anyway, pushed an additional statement that modifies the internal state directly before sending stuff to home assistant to allow for more consistent cycling. As my main entity has an screen-20240118-215608.2.mp4
You're probably talking about the ModeAction which is probably intended to be triggered by that |
This does result in weird looking updates with 2 transitions where state and temperature update independently. Why do this manually when all other controls depend entirely on the state to change on the server? This way the state will appear updated even if it failed. The "Toggle climate" string in line 76 should also be translated, or use a more generic "Toggle" like already exists in the strings file. |
83ebf35
to
da759ea
Compare
The intention was that a "double-press" would be more responsive on that, as the new state is already internal and another press would then go to the next state before the update has propagated to the server. Not sure if it actually works like that.
Thanks for the hint, adapted that. |
|
app/src/main/java/io/homeassistant/companion/android/controls/ClimateControl.kt
Outdated
Show resolved
Hide resolved
GitHub Actions can be flaky sometimes, we can/will restart it for you in that case :) |
@jpelgrom In general I also wanted to ask whether this PR has a good chance of being merged, once stuff is implemented properly? I feel like it's kind of a hack using a Toggle for an action that's cycling through modes, but one that enhances usability with the way android is implementing their controls right now. |
Sorry for the confusion, that was implied by reviewing the code - as far as I'm concerned this would be accepted when properly implemented and I currently don't see anything that would block it. You've described a good use case, it doesn't conflict with existing functionality and while you may consider this a hack it also doesn't feel unexpected/Android isn't exposing the modes otherwise. We've updated the linter which might throw failures after merging this branch - if you can, please rebase your PR. |
20c974e
to
44fb3c5
Compare
app/src/main/java/io/homeassistant/companion/android/controls/ClimateControl.kt
Show resolved
Hide resolved
Tested and left one minor comment, otherwise it's looking good! Do you also want to submit a documentation PR to reflect that it is not just a temperature slider, but also cycles through modes when tapped now? |
Surely can do so within the next days. I assume you mean here: https://github.com/home-assistant/companion.home-assistant/blob/master/docs/integrations/android-device-controls.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks for implementing it!
Yes, that'd be the place to add it. Don't forget to add a beta label (see any recent documentation PR as an example). |
Summary
The ClimateControl right now doesn't cycle through modes (toggle in case it's a normal heating) when clicking on it within "Device controls" on Android which means more hassle when trying to change modes, as I would have to go into the app and in general it requires more clicks.
Screenshots/Screencast
Screencast.from.2024-01-17.20-23-47.webm
Link to pull request in Documentation repository
None so far. If that is needed, please come back to me.
Any other notes
Didn't know whether I should create an issue for that just to have the implementation directly around and decided against that. In case I missed some workflow feel free to reach out to me. Would be happy to see this change merged