mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-10 19:45:39 +00:00
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:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user