broken mqtt discovery edge case fix?

This commit is contained in:
openshwprojects
2023-01-16 10:08:57 +01:00
parent bd84eb4878
commit ddbf8e3ec0

View File

@ -1625,6 +1625,9 @@ void doHomeAssistantDiscovery(const char *topic, http_request_t *request) {
}
if (pwmCount == 5 || ledDriverChipRunning) {
if (dev_info == NULL) {
dev_info = hass_init_light_device_info(LIGHT_RGBCW);
}
// Enable + RGB control + CW control
MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);
hass_free_device_info(dev_info);