mirror of
https://github.com/espressif/esp-rainmaker.git
synced 2026-01-15 02:12:26 +00:00
Merge branch 'fix_matter_light_build' into 'master'
examples: fix matter_light building See merge request app-frameworks/esp-rainmaker!414
This commit is contained in:
@@ -90,7 +90,7 @@ esp_err_t app_driver_light_set_defaults()
|
||||
cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
attribute = attribute::get(cluster, ColorControl::Attributes::ColorMode::Id);
|
||||
attribute::get_val(attribute, &val);
|
||||
if (val.val.u8 == EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION) {
|
||||
if (val.val.u8 == static_cast<uint8_t>(ColorControl::ColorMode::kCurrentHueAndCurrentSaturation)) {
|
||||
/* Setting hue */
|
||||
attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
|
||||
attribute::get_val(attribute, &val);
|
||||
@@ -99,7 +99,7 @@ esp_err_t app_driver_light_set_defaults()
|
||||
attribute = attribute::get(cluster, ColorControl::Attributes::CurrentSaturation::Id);
|
||||
attribute::get_val(attribute, &val);
|
||||
err |= app_driver_light_set_saturation(handle, REMAP_TO_RANGE(val.val.u8, MATTER_SATURATION, STANDARD_SATURATION));
|
||||
} else if (val.val.u8 == EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE) {
|
||||
} else if (val.val.u8 == static_cast<uint8_t>(ColorControl::ColorMode::kColorTemperature)) {
|
||||
/* Setting temperature */
|
||||
attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <led_driver.h>
|
||||
#include <esp_matter_rainmaker.h>
|
||||
#include <platform/ESP32/route_hook/ESP32RouteHook.h>
|
||||
#include <app/clusters/color-control-server/color-control-server.h>
|
||||
#include <app/server/Server.h>
|
||||
#include <esp_matter_console.h>
|
||||
#include <app_matter.h>
|
||||
@@ -244,8 +245,9 @@ esp_err_t app_matter_light_create(app_driver_handle_t driver_handle)
|
||||
light_config.on_off.lighting.start_up_on_off = nullptr;
|
||||
light_config.level_control.current_level = DEFAULT_BRIGHTNESS;
|
||||
light_config.level_control.lighting.start_up_current_level = DEFAULT_BRIGHTNESS;
|
||||
light_config.color_control.color_mode = EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE;
|
||||
light_config.color_control.enhanced_color_mode = EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE;
|
||||
light_config.color_control.color_mode = static_cast<uint8_t>(ColorControl::ColorMode::kColorTemperature);
|
||||
light_config.color_control.enhanced_color_mode =
|
||||
static_cast<uint8_t>(ColorControlServer::EnhancedColorMode::kColorTemperature);
|
||||
light_config.color_control.color_temperature.startup_color_temperature_mireds = nullptr;
|
||||
endpoint_t *endpoint = extended_color_light::create(node, &light_config, ENDPOINT_FLAG_NONE, driver_handle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user