Merge pull request #6548 from effelle/development

Home Assistant integration BTN/SW
This commit is contained in:
Theo Arends 2019-10-02 18:36:42 +02:00 committed by GitHub
commit b4cac5c038
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
char *tmp = Settings.switch_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++) {
uint8_t switch_present = 0;
uint8_t toggle = 1;
@ -376,7 +376,7 @@ void HAssAnnounceButtons(void)
// Send info about buttons
char *tmp = Settings.button_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++) {
uint8_t button_present = 0;
uint8_t toggle = 1;