HASS Discovery for color temperature range. (#736)

* Add Color Temperature Range to HASS Discovery.

Add min_mireds and max_mireds to lights with color temperature capability.

* Update hass.h

* Debug logging.

* mireds as int rather than float.

* Removed debug logging.
This commit is contained in:
ekobres
2023-03-17 07:58:34 -04:00
committed by GitHub
parent df58916729
commit 137c815dfb
2 changed files with 7 additions and 0 deletions

View File

@ -282,6 +282,12 @@ HassDeviceInfo* hass_init_light_device_info(ENTITY_TYPE type) {
cJSON_AddStringToObject(info->root, "clr_temp_cmd_t", g_hassBuffer); //color_temp_command_topic
cJSON_AddStringToObject(info->root, "clr_temp_stat_t", "~/led_temperature/get"); //color_temp_state_topic
sprintf(g_hassBuffer, "%.0f", led_temperature_min);
cJSON_AddStringToObject(info->root, "min_mirs", g_hassBuffer); //min_mireds
sprintf(g_hassBuffer, "%.0f", led_temperature_max);
cJSON_AddStringToObject(info->root, "max_mirs", g_hassBuffer); //max_mireds
}
cJSON_AddStringToObject(info->root, STATE_TOPIC_KEY, "~/led_enableAll/get"); //state_topic

View File

@ -3,6 +3,7 @@
#include "../cJSON/cJSON.h"
#include "../new_pins.h"
#include "../mqtt/new_mqtt.h"
#include "../cmnds/cmd_public.h"
typedef enum {
/// @brief Switch