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

"error", "readonly" and "isswitch" variables #80

Merged
merged 14 commits into from Apr 17, 2020

Conversation

dukess
Copy link
Contributor

@dukess dukess commented Apr 16, 2020

Added "error", "readonly" and "isswitch" variables for enriching JSON.
Saving some RAM.

dukess and others added 11 commits March 25, 2020 13:34
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
@dukess dukess mentioned this pull request Apr 16, 2020
@fredlcore
Copy link
Owner

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"));
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 :)

Copy link
Contributor Author

@dukess dukess Apr 16, 2020

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
@dukess dukess marked this pull request as ready for review April 16, 2020 16:36
Some parameters can be accessed through web interface but not JSON
@fredlcore fredlcore merged commit 7f3c56b into fredlcore:master Apr 17, 2020
@fredlcore
Copy link
Owner

Thanks a lot for all the changes, merged now.

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

Successfully merging this pull request may close these issues.

None yet

3 participants