Skip to content

Commit

Permalink
Add "event" key to discovery message for push button events
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Jul 23, 2024
1 parent 3488524 commit 31572ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/gpio/hasp_gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,8 @@ void gpio_discovery(JsonObject& input, JsonArray& relay, JsonArray& light, JsonA
strcpy_P(description, PSTR("unknown"));
}

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)) {
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)) {
JsonArray arr = input[description];
if(arr.isNull()) arr = input.createNestedArray(description);
arr.add(gpioConfig[i].pin);
Expand Down

0 comments on commit 31572ef

Please sign in to comment.