Update xdrv_12_home_assistant.ino

This commit is contained in:
Federico Leoni 2019-10-02 13:16:14 -03:00 committed by GitHub
parent bc55237154
commit 4eef80e4d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -347,7 +347,7 @@ void HAssAnnounceSwitches(void)
// Send info about buttons // Send info about buttons
char *tmp = Settings.switch_topic; char *tmp = Settings.switch_topic;
Format(sw_topic, tmp, sizeof(sw_topic)); Format(sw_topic, tmp, sizeof(sw_topic));
if ((strlen(sw_topic) != 0) && strcmp(sw_topic, "0")) { if (strlen(sw_topic) != 0) {
for (uint32_t switch_index = 0; switch_index < MAX_SWITCHES; switch_index++) { for (uint32_t switch_index = 0; switch_index < MAX_SWITCHES; switch_index++) {
uint8_t switch_present = 0; uint8_t switch_present = 0;
uint8_t toggle = 1; uint8_t toggle = 1;
@ -376,7 +376,7 @@ void HAssAnnounceButtons(void)
// Send info about buttons // Send info about buttons
char *tmp = Settings.button_topic; char *tmp = Settings.button_topic;
Format(key_topic, tmp, sizeof(key_topic)); Format(key_topic, tmp, sizeof(key_topic));
if ((strlen(key_topic) != 0) && strcmp(key_topic, "0")) { if (strlen(key_topic) != 0) {
for (uint32_t button_index = 0; button_index < MAX_KEYS; button_index++) { for (uint32_t button_index = 0; button_index < MAX_KEYS; button_index++) {
uint8_t button_present = 0; uint8_t button_present = 0;
uint8_t toggle = 1; uint8_t toggle = 1;