OpenSprinkler / OpenSprinkler-App

A mobile interface for the OpenSprinkler irrigation device. Designed to allow manual control, program management (preview, add, edit, and delete), initiation of a run-once program, viewing graphical and tabulated representations of log data, viewing device status, adjusting rain delay, and changing of OpenSprinkler settings.
https://opensprinkler.com
GNU Affero General Public License v3.0
168 stars 91 forks source link

Add support for grouped stations #116

Closed rianadon closed 3 years ago

rianadon commented 3 years ago

I'm adding support for reading & modifying the station groups ids, which is not yet merged into the OpenSprinkler firmware but hopefully will be soon (see https://github.com/OpenSprinkler/OpenSprinkler-Firmware/pull/171 + another PR to come).

Since these changes keep compatibility with the existing firmware, I thought I'd submit this one early. Compatibility is kept by giving every station a default group id of zero, which is equivalent to just not having groups.

Screenshot of the field to edit the station id in zone settings:

image

I'm not familiar with the UI library the app uses, so I just copied the station field name and un-bolded the text inside the input. A much thinner field that aligns with the checkboxes (group ids go from only 0 to 15) would be ideal, but I didn't know how to make that.

Also, grouping ids are irrelevant & should be disabled if sequential is unchecked, but I don't know what the best way to go about that is.

Preview program view (S01 and S02 are group 1, S03, S04, and S05 are group 2):

image

The same set of programs, after reverting to the latest OpenSprinkler firmware:

image
salbahra commented 3 years ago

Going to go ahead and merge this and release to the beta firmware track to allow for testing.

Thanks again!

salbahra commented 3 years ago

Apologizes but this PR had to be reverted. The preview stops working with older firmwares, etc. Please re-open if you can adapt the code to support all firmwares.

Thank you!