-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Change key-names in JSON to be compliant and consistent #1860
Comments
Yes, i like that.
|
Please consider to align mqtt (ha) and api names. |
yes camelCase. in the API, the URL won't be case sensitive. In HA I need to check if the sensor names are case sensitive. right now, it's all lower-case which is fine. The recommendation from https://github.com/Trikos/Home-Assistant-Naming-Convention is to use underscores, which I don't like. |
So I propose, for starters, to change to use camelCase and no spaces or special characters in:
|
@proddy please allow the following remarks / questions: Whenever names are changed for mqtt (HA) the old entities became inactive and the old statistic records are kept. This is not nice and needs manual intervention next to adjusting dashboards. Is there any proposed way how to do this with minimum effort? Or can this be done without manual intervention? Within ioBroker I changed the code to recreate the object structure for /system/info on every instance restart. |
I agree we should avoid making any major changes to the HA historical data. With my plan above, only 3 sensor IDs will change in HA: bus_status, uptime_sec, ntp_status But we can decide not change that, and it would mean nothing changes in HA. That leaves
|
I changed heartbeat and info, but it also impacted HA's entities, so I'll leave those two and only change system/info. |
@tp1de note system/info is changed so you'll need to adjust your ioBroker code accordingly |
The key names are inconsistent in the downloaded
emsesp_settings.json
file which is the same as the API callhttp://ems-esp.local/api/system
.I'd like to rename the keys to either camel-case or snake-case, following the standards that the JSON org and Google recommend: https://restfulapi.net/valid-json-key-names/ https://google.github.io/styleguide/jsoncstyleguide.xml?showone=Key_Names_in_JSON_Maps#Key_Names_in_JSON_Maps
This would mean names like
"publish time solar"
would become"publishTimeSolar"
using camel-case. And"Network Info"
changes to just"network"
.Only the System Info would be impacted. The devices and other entities are in lowercase without spaces and can stay like that.
@tp1de @MichaelDvP
The text was updated successfully, but these errors were encountered: