diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index fbedc0b0b2e1d4..42ce1c5fe3403a 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -271,6 +271,24 @@ class EditAttributeListModel : public TouchesMatterStackModel // update the temp attribute here for hardcoded endpoint 1 chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Set(1, static_cast(n * 100)); } + else if (name == "Color Current Level") + { + // update the current level here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Brightness changed to : %d", (n * 100 / 255)); + app::Clusters::LevelControl::Attributes::CurrentLevel::Set(1, n); + } + else if (name == "Current Hue") + { + // update the current hue here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Hue changed to : %d", n * 360 / 254); + app::Clusters::ColorControl::Attributes::CurrentHue::Set(1, n); + } + else if (name == "Current Saturation") + { + // update the current saturation here for hardcoded endpoint 1 + ESP_LOGI(TAG, "Saturation changed to : %d", n * 100 / 254); + app::Clusters::ColorControl::Attributes::CurrentSaturation::Set(1, n); + } value = buffer; } else if (IsBooleanAttribute()) @@ -576,6 +594,21 @@ void SetupPretendDevices() AddCluster("Illuminance Measurement"); AddAttribute("MeasuredValue", "1000"); app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::Set(1, static_cast(1000)); + + AddDevice("Color Light"); + AddEndpoint("1"); + AddCluster("OnOff"); + AddAttribute("OnOff", "Off"); + app::Clusters::OnOff::Attributes::OnOff::Set(1, false); + AddCluster("Level Control"); + AddAttribute("Color Current Level", "255"); + app::Clusters::LevelControl::Attributes::CurrentLevel::Set(1, 255); + AddEndpoint("2"); + AddCluster("Color Control"); + AddAttribute("Current Hue", "200"); + app::Clusters::ColorControl::Attributes::CurrentHue::Set(1, 200); + AddAttribute("Current Saturation", "150"); + app::Clusters::ColorControl::Attributes::CurrentSaturation::Set(1, 150); } WiFiWidget pairingWindowLED;