vinteo / hass-opensprinkler

OpenSprinkler Integration for Home Assistant
MIT License
211 stars 40 forks source link

feat: Edit Interval, Starting In Days #235

Closed EdLeckert closed 1 year ago

EdLeckert commented 1 year ago

New feature to view/edit Interval Days and Starting In Days.

I struggled a bit with the "mode" property. I originally had it set to "box" because that's what I prefer, but the docs suggest setting it to "auto", which seems to give the same result as "slider", the default. The HA UI has little to no support for adjusting this that I can find. However, I discovered that the Mushroom Number card has support for setting this to "Slider" or "Buttons" (similar to "box" but without ability to type a value). So I pulled these values out of the Entities card I'm using on my panel and tried the Mushroom approach, which looks like it will work for me.

Note that this will affect the Station Durations as well. The are set to "auto" currently.

Thoughts? Do you know of any other cards that allow choosing a different mode? What should our default be?

EdLeckert commented 1 year ago

I also have to add some business logic and set min/max, so this is not ready to go quite yet.

vinteo commented 1 year ago

I think i prefer it to go with the recommended auto. I think it might be possible to have a integration config that the user can set (like for HACS screenshot below) and we can use that value but I think that will require a lot more work.

image

For now like you said the Mushroom custom card could provide an alternative for now.

EdLeckert commented 1 year ago

OK, sounds good on the mode.

I pushed another version with min and max set dynamically. The logic mimics what the web UI does to prevent Starting In from going above Interval Days minus one. Let me know if you know of a better way to check the other value's setting.

Once you're happy I'll do a final squash.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

EdLeckert commented 1 year ago

Is there something else I need to do before you can merge this?