new hass discovery case fix

This commit is contained in:
openshwprojects
2023-05-01 20:17:13 +02:00
parent 83871bf889
commit b6e911fef8

View File

@ -219,6 +219,9 @@ HassDeviceInfo* hass_init_device_info(ENTITY_TYPE type, int index, char* payload
case VOLTAGE_SENSOR:
sprintf(g_hassBuffer, "%s Voltage", CFG_GetShortDeviceName());
break;
default:
sprintf(g_hassBuffer, "%s %i", CFG_GetShortDeviceName(), index);
break;
}
cJSON_AddStringToObject(info->root, "name", g_hassBuffer);
cJSON_AddStringToObject(info->root, "~", CFG_GetMQTTClientId()); //base topic