Skip to content
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

_set_option (and set_water_level which uses it) are currently unsafe on firmwares below 2.1.9 #64

Open
cmccambridge opened this issue May 31, 2022 · 0 comments

Comments

@cmccambridge
Copy link
Contributor

While chasing my tail on adding support to set and read back the time zone UTC offset in #63, I discovered that the _set_option method, as currently implemented, is only safe for firmwares 2.1.9 and above. The reason is: the syntax for the /co API had a breaking change in firmware 2.1.9:

  1. Major Changes
    Compared to previous firmwares, some of the major changes in this firmware that affect the APIs include:
    ● Changing of option values (/co) now supports using JSON names. The previous way of using option index is no longer supported.

Prior to firmware 2.1.9, the /co Change Option API endpoint used a different syntax (e.g. 2.1.8 API manual):

  • Instead of JSON variable names, each option was numbered with an index, like o1 instead of tz for Time Zone, or o23 instead of wl for Water Level.
  • In those o?? firmwares, several options are highlighted in the API spec as boolean options which are set or cleared on every /co call, by whether or not they are present in the query string at all. (Value can be absent and is ignored... just presence = true, absence = false.)
    image

So for the existing set_water_level routine: if we call that on a controller running older firmware than 2.1.9, not only will it not set the water level (since it is passing wl=<value> instead of o23=<value>, but 🐛 we'll actually be clearing options like o3 "Use DHCP"

So this issue is to either disable the _set_option routine for the older firmwares, OR, to build in proper support to use /co safely on those versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant