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
"error", "readonly" and "isswitch" variables #80
Conversation
BSB-lan return page without header and footer when using /W flag (/WI, /WS)
Experimental support for "readonly" flag and "error" status field in JSON
1. revert changes for one value (1) instead two (1 and 255) for YESNO and ONOFF. 2. Breaking compatibility: New data type DT_OOYN instead DT_ENUM for YESNO and ONOFF
Add isswitch field in json for YESNO and ONOFF types
Looks fine for me - although I cannot merge because it says "pull request is still a work in progress"? |
BSB_lan.ino
Outdated
@@ -6088,6 +6174,7 @@ uint8_t pps_offset = 0; | |||
} | |||
//client.println(); | |||
strcpy_P(jsonbuffer, PSTR("\n ],\n")); | |||
if(decodedTelegram.isswitch == 1) strcat_P(jsonbuffer, PSTR(" \"isswitch\": 1,\n")); |
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.
Just asking me: wouldn't it be a nicer API design to always add the isswitch
member and instead set it to 0 or 1?
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.
isswitch = 0 only for ENUMS or for any dataType?
P.S. I would prefer YESNO and ONOFF to be a separate data type (this would look nicer), but then compatibility would be broken. We discussed this with Frederik and traces of experiments can be found in this patch.
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.
For all dataTypes.
Regarding the separate dataTypes: I was thinking of the same when implementing an openHab binding :)
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.
I think it will be redundant, because for all other types it will be always 0.
Look at last change: eeee2d3
Maybe in the future we can implement this after some big release.
add "readonly" flag for category list, "isswitch" always visible for ENUM
Some parameters can be accessed through web interface but not JSON
Thanks a lot for all the changes, merged now. |
Added "error", "readonly" and "isswitch" variables for enriching JSON.
Saving some RAM.