mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-19 09:16:41 +00:00
Add "event" key to discovery message for push button events
This commit is contained in:
parent
348852476d
commit
31572ef9d0
@ -954,8 +954,8 @@ void gpio_discovery(JsonObject& input, JsonArray& relay, JsonArray& light, JsonA
|
|||||||
strcpy_P(description, PSTR("unknown"));
|
strcpy_P(description, PSTR("unknown"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if((gpioConfig[i].type >= hasp_gpio_type_t::SWITCH && gpioConfig[i].type <= hasp_gpio_type_t::WINDOW) ||
|
if((gpioConfig[i].type >= hasp_gpio_type_t::SWITCH && gpioConfig[i].type <= hasp_gpio_type_t::WINDOW)) {
|
||||||
(gpioConfig[i].type >= hasp_gpio_type_t::BUTTON && gpioConfig[i].type <= hasp_gpio_type_t::TOUCH)) {
|
// || (gpioConfig[i].type >= hasp_gpio_type_t::BUTTON && gpioConfig[i].type <= hasp_gpio_type_t::TOUCH)) {
|
||||||
JsonArray arr = input[description];
|
JsonArray arr = input[description];
|
||||||
if(arr.isNull()) arr = input.createNestedArray(description);
|
if(arr.isNull()) arr = input.createNestedArray(description);
|
||||||
arr.add(gpioConfig[i].pin);
|
arr.add(gpioConfig[i].pin);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user