-
Notifications
You must be signed in to change notification settings - Fork 113
Added ESP32 support, slider, color, dropdown, toggle controls and som… … 10658fc …e other bonuses #44
Conversation
Merge edits from maakbaas master
Example UI and associated config definition: [
{
"name": "hostName",
"label": "Host Name",
"type": "char",
"length": 32,
"value": "Haptic-01"
},
{
"name": "projectName",
"label": "Project Name",
"type": "char",
"length": 32,
"value": "Haptic Light ESP8266"
},
{
"name": "mode",
"label": "Mode",
"type": "char",
"length": 20,
"inputControl": "select",
"value": "Aurora",
"options": [
"Aurora",
"Blue",
"Blue Wave",
"Custom Color",
"Custom Wave",
"Sunset",
"Ocean",
"Rainbow",
"White",
"White Wave"
]
},
{
"name": "brightness",
"label": "Brightness",
"type": "uint8_t",
"inputControl": "slider",
"value": 25,
"min": 1,
"max": 100
},
{
"name": "nightBrightness",
"label": "Night Brightness",
"type": "uint8_t",
"inputControl": "slider",
"value": 20,
"min": 1,
"max": 100
},
{
"name": "isActive",
"label": "Is Active",
"type": "bool",
"value": true
},
{
"name": "isPlaying",
"label": "Is Animated",
"type": "bool",
"value": true
},
{
"name": "color",
"label": "Custom Color",
"type": "char",
"length": 11,
"inputControl": "color",
"value": "#ff00ff"
},
{
"name": "speed",
"label": "Speed",
"type": "uint8_t",
"inputControl": "slider",
"value": 23,
"min": 1,
"max": 200
},
{
"name": "isPirSensorEnabled",
"label": "Auto Motion detection",
"type": "bool",
"value": true
},
{
"name": "pirActiveTimeoutSecs",
"label": "Auto light timeout secs",
"type": "uint16_t",
"inputControl": "slider",
"value": 60,
"min": 10,
"max": 300
},
{
"name": "isLuxSensorEnabled",
"label": "Auto LUX brightness",
"type": "bool",
"value": true
},
{
"name": "isTempSensorEnabled",
"label": "Detect Temp/Humidity",
"type": "bool",
"value": false
},
{
"name": "pixelCount",
"label": "LED count",
"type": "uint16_t",
"value": 110,
"min": 10,
"max": 300
},
{
"name": "dummyFloat",
"type": "float",
"hidden": true,
"min": 1,
"max": 10,
"value": 1.2345
},
{
"name": "dummyString",
"type": "char",
"length": 11,
"hidden": true,
"value": "invisible!"
}
] |
Am investigating and fixing ESLint related failures @ https://travis-ci.com/github/maakbaas/esp8266-iot-framework/jobs/407066412 |
@maakbaas, please let me know what you think of how the additional UI controls can be used. If you agree with the approach, after accommodating feedback from you (and others), I'll push another commit with usage information added to https://github.com/maakbaas/esp8266-iot-framework/blob/master/docs/config-manager.md |
…ggle switch is always applied to bool type.
@aaronse thanks for the major contributions in this pull request! The combination of items makes it a bit difficult to review and make it ready to merge. Can you please split this in a stacked or multiple pull requests? That would be really appreciated.
|
Hello @maakbaas! Quick update since am away for a few days. Totally understand about single pull request being tricky to review. Am splitting the ESP32 and Input Control changes to separate pull requests. Will submit Input Control pull request first, is more complete and would immediately help folks with similar requirements to me. wrt ESP32 edits, you're right. A bunch of functionality was not ported. I only ported the functionality immediately needed for projects am actively working on. Was hoping to either get around to fleshing out the remaining work, or rely on someone else to step in that needs those edits more urgently than me. Thanks for the feedback about misc unrequired edits, fixing/fixed those. hasConfigChanged was a simple hook added to enable my calling app to determine whether the Web User edited/saved the config. My calling app's loop() does something different if the config was changed. A better, longer to implement, alternative considered... Implement some kind of configManager::getConfigHashCode(), or maybe call an existing compute hashcode function in some crypto lib. Computing hash of the config struct's bytes would allow calling apps to detect config changes (because they'd compare last known hashcode), this would also allow calling apps to ignore saves that didn't actually change any setting values. |
I will close this pull request for now. Looking forward to the separated items! |
No description provided.