mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-14 15:45:23 +00:00
HA Assistent fixes. "dev_cla" specs changed changed.
TuyaMCU - added comments
This commit is contained in:
@ -243,7 +243,7 @@ HassDeviceInfo* hass_init_light_device_info(ENTITY_TYPE type, int index) {
|
||||
}
|
||||
if ((index >= OBK_CONSUMPTION_TOTAL) && (index <= OBK_CONSUMPTION_STATS))
|
||||
{
|
||||
cJSON_AddStringToObject(info->root, "dev_cla", counter_mqttNames[index - OBK_CONSUMPTION_TOTAL]); //device_class=consumption
|
||||
cJSON_AddStringToObject(info->root, "dev_cla", counter_devClasses[index - OBK_CONSUMPTION_TOTAL]); //device_class=consumption
|
||||
|
||||
sprintf(g_hassBuffer, "%s/%s/get", clientId, counter_mqttNames[index - OBK_CONSUMPTION_TOTAL]);
|
||||
cJSON_AddStringToObject(info->root, STATE_TOPIC_KEY, g_hassBuffer);
|
||||
|
||||
@ -1322,7 +1322,7 @@ int http_fn_ha_discovery(http_request_t* request) {
|
||||
|
||||
#ifndef OBK_DISABLE_ALL_DRIVERS
|
||||
if (measuringPower == true) {
|
||||
for (i = 0;i < OBK_NUM_MEASUREMENTS;i++)
|
||||
for (i = 0;i < OBK_NUM_SENSOR_COUNT;i++)
|
||||
{
|
||||
HassDeviceInfo* dev_info = hass_init_light_device_info(ENTITY_SENSOR, i);
|
||||
MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);
|
||||
|
||||
Reference in New Issue
Block a user