From 1c887053d72f164daf5f24a1f7c78b17f6fb9f07 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Wed, 27 Dec 2023 10:48:27 +0800 Subject: [PATCH] examples: fix matter_light building --- examples/matter/matter_light/main/app_driver.cpp | 4 ++-- examples/matter/matter_light/main/app_matter.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/matter/matter_light/main/app_driver.cpp b/examples/matter/matter_light/main/app_driver.cpp index 05c69ab..4511695 100644 --- a/examples/matter/matter_light/main/app_driver.cpp +++ b/examples/matter/matter_light/main/app_driver.cpp @@ -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(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(ColorControl::ColorMode::kColorTemperature)) { /* Setting temperature */ attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id); attribute::get_val(attribute, &val); diff --git a/examples/matter/matter_light/main/app_matter.cpp b/examples/matter/matter_light/main/app_matter.cpp index c8376d6..582dca4 100644 --- a/examples/matter/matter_light/main/app_matter.cpp +++ b/examples/matter/matter_light/main/app_matter.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -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(ColorControl::ColorMode::kColorTemperature); + light_config.color_control.enhanced_color_mode = + static_cast(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);