tuyamcu hass discoery edge case fix

This commit is contained in:
Tester23
2023-11-29 13:04:13 +01:00
parent 948f1f8a62
commit 960f281102

View File

@ -1759,6 +1759,10 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
#endif
//if (relayCount > 0) {
for (i = 0; i < CHANNEL_MAX; i++) {
// if already included by light, skip
if (BIT_CHECK(flagsChannelPublished, i)) {
continue;
}
bool bToggleInv = g_cfg.pins.channelTypes[i] == ChType_Toggle_Inv;
if (h_isChannelRelay(i) || g_cfg.pins.channelTypes[i] == ChType_Toggle || bToggleInv) {
// TODO: flags are 32 bit and there are 64 max channels