Skip to content

Commit

Permalink
addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirsrin committed Jul 5, 2024
1 parent 4fdadff commit ddc8750
Show file tree
Hide file tree
Showing 28 changed files with 45 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5460,7 +5460,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4008,7 +4008,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
12 changes: 6 additions & 6 deletions examples/common/imgui_ui/windows/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ void Light::Render()
ImGui::Text("Color Control:");
ImGui::Indent();
const char * mode = // based on ColorMode attribute: spec 3.2.7.9
(mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation) ? "Hue/Saturation"
: (mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentXAndCurrentY) ? "X/Y"
: (mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kColorTemperatureMireds) ? "Temperature/Mireds"
(mColorMode == ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation) ? "Hue/Saturation"
: (mColorMode == ColorControl::ColorModeEnum::kCurrentXAndCurrentY) ? "X/Y"
: (mColorMode == ColorControl::ColorModeEnum::kColorTemperatureMireds) ? "Temperature/Mireds"
: "UNKNOWN";

ImGui::Text("Mode: %s", mode);

if (mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation)
if (mColorMode == ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation)
{
const float hueDegrees = (mColorHue * 360.0f) / 254.0f;
const float saturationPercent = 100.0f * (mColorSaturation / 254.0f);
Expand All @@ -173,12 +173,12 @@ void Light::Render()
ImGui::ColorButton("LightColor", HueSaturationToColor(hueDegrees, saturationPercent), 0 /* ImGuiColorEditFlags_* */,
ImVec2(80, 80));
}
else if (mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentXAndCurrentY)
else if (mColorMode == ColorControl::ColorModeEnum::kCurrentXAndCurrentY)
{
ImGui::Text("Current X: %d", mColorX);
ImGui::Text("Current Y: %d", mColorY);
}
else if (mColorMode == chip::app::Clusters::ColorControl::ColorModeEnum::kColorTemperatureMireds)
else if (mColorMode == ColorControl::ColorModeEnum::kColorTemperatureMireds)
{
ImGui::Text("Color Temperature Mireds: %d", mColorTemperatureMireds);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/common/m5stack-tft/repo
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/qpg/zap/switch.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg/zap/light.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
7 changes: 3 additions & 4 deletions examples/lighting-app/tizen/src/DBusInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void DBusInterface::SetCurrentLevel(uint8_t value)
light_app_level_control_set_current_level(mIfaceLevelControl, value);
}

void DBusInterface::SetColorMode(chip::app::Clusters::ColorControl::ColorModeEnum colorMode)
void DBusInterface::SetColorMode(chip::app::Clusters::ColorControl::ColorMode colorMode)
{
InternalSetGuard guard(this);
if (light_app_color_control_get_color_mode(mIfaceColorControl) != chip::to_underlying(colorMode))
Expand Down Expand Up @@ -217,12 +217,11 @@ void DBusInterface::InitOnOff()
void DBusInterface::InitColor()
{
{
chip::app::Clusters::ColorControl::ColorModeEnum value =
chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation;
auto value = 0;
auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status)));
light_app_color_control_set_color_mode(mIfaceColorControl, static_cast<guchar>(value));
light_app_color_control_set_color_mode(mIfaceColorControl, value);
}
{
uint16_t value = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/src/DBusInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DBusInterface
void Identify(uint16_t time);
void SetOnOff(bool on);
void SetCurrentLevel(uint8_t value);
void SetColorMode(chip::app::Clusters::ColorControl::ColorModeEnum colorMode);
void SetColorMode(chip::app::Clusters::ColorControl::ColorMode colorMode);
void SetColorTemperature(uint16_t value);

private:
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
switch (attributePath.mAttributeId)
{
case Clusters::ColorControl::Attributes::ColorMode::Id:
sDBusInterface.SetColorMode(static_cast<Clusters::ColorControl::ColorModeEnum>(*value));
sDBusInterface.SetColorMode(static_cast<Clusters::ColorControl::ColorMode>(*value));
break;
case Clusters::ColorControl::Attributes::ColorTemperatureMireds::Id:
VerifyOrDie(size == sizeof(uint16_t));
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5577,7 +5577,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down Expand Up @@ -5905,7 +5905,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5534,7 +5534,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down Expand Up @@ -5862,7 +5862,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
9 changes: 9 additions & 0 deletions src/app/common/CompatEnumNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ using StepMode = StepModeEnum;
using LevelControlOptions = OptionsBitmap;
} // namespace LevelControl

namespace ColorControl {
// https://github.com/project-chip/connectedhomeip/pull/33612 renamed this
using ColorMode = ColorModeEnum;
using ColorTemperature = ColorTemperatureMireds;
using ColorCapabilities = ColorCapabilitiesBitmap;
using ColorLoopUpdateFlags = UpdateFlagsBitmap;
using ColorLoopAction = ColorLoopActionEnum;
} // namespace ColorControl

namespace RefrigeratorAlarm {
// https://github.com/project-chip/connectedhomeip/pull/31517 renamed this
using AlarmMap = AlarmBitmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ limitations under the License.
<cluster code="0x0300"/>
<item name="None" value="0x00"/>
<item name="OtherOrUnknown" value="0x01"/>
<item name="Temperaturemonitoring" value="0x02"/>
<item name="TemperatureMonitoring" value="0x02"/>
<item name="OpticalLuminanceMonitoringAndFeedback" value="0x03"/>
<item name="OpticalColorMonitoringAndFeedback" value="0x04"/>
</enum>
Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -6933,7 +6933,7 @@ cluster ColorControl = 768 {
enum DriftCompensationEnum : enum8 {
kNone = 0;
kOtherOrUnknown = 1;
kTemperaturemonitoring = 2;
kTemperatureMonitoring = 2;
kOpticalLuminanceMonitoringAndFeedback = 3;
kOpticalColorMonitoringAndFeedback = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ddc8750

Please sign in to comment.