OpenSprinkler › Forums › OpenSprinkler Unified Firmware › API – Change Station Names and Attributes › Reply To: API – Change Station Names and Attributes
OK. I understand the legacy rational, but it does make it more complicated for the programmer. A simple station attribute change becomes a ‘group of 8’ station update (even the use of the term ‘board index’ has a legacy definition since expansion boards have 16 stations on them). OK, I’ll stop whining…
In the ‘cs’ definition the ‘?’ is used in 2 ways: It is the station index when use with ‘s’ and it is the board index when used with ‘m’ and ‘n’, both of which are stated explicitly and the examples show them, For ‘i’, ‘d’ and ‘q’, ‘?’ is not defined explicitly nor are there examples for them. I can see what you intended now, but since these are all per-station attributes, it seemed like ‘m’ and ‘n’ were the exceptions because the use of ‘?’ was explicitly defined for them.
My suggestion for the API doc: For ‘i’, ‘d’, and ‘q’, state explicitly that ‘?’ is the board index in the same why that it is done for ‘m’ and ‘n’ OR at the start of the Parameter section state that ‘?’ is the board index except when used with ‘s’. Also, there should be a note to remind the programmer that when changing a station attribute, other than its name, you have to preserve the state of the other stations on that board index.