mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-22 18:35:36 +00:00
HA discovery energy_sensor from tuyaMCU (#864)
Handle EnergyTotal_kWh_div1000
This commit is contained in:
committed by
GitHub
parent
12cb936ecf
commit
23cbd2c7f1
@ -1981,6 +1981,24 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
|
||||
discoveryQueued = true;
|
||||
}
|
||||
break;
|
||||
case ChType_EnergyTotal_kWh_div100:
|
||||
{
|
||||
dev_info = hass_init_sensor_device_info(ENERGY_SENSOR, i, 3, 2);
|
||||
MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);
|
||||
hass_free_device_info(dev_info);
|
||||
|
||||
discoveryQueued = true;
|
||||
}
|
||||
break;
|
||||
case ChType_EnergyTotal_kWh_div1000:
|
||||
{
|
||||
dev_info = hass_init_sensor_device_info(ENERGY_SENSOR, i, 3, 3);
|
||||
MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);
|
||||
hass_free_device_info(dev_info);
|
||||
|
||||
discoveryQueued = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user