Skip to content

Commit

Permalink
ci(pre-commit): Apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Nov 20, 2024
1 parent f7c25b1 commit 3e0d084
Show file tree
Hide file tree
Showing 4 changed files with 265 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool setLightState(bool state, uint8_t brightness, uint16_t temperature_Mireds)

if (state) {
#ifdef RGB_BUILTIN
CtColor_t ct = { temperature_Mireds };
CtColor_t ct = {temperature_Mireds};
RgbColor_t rgb_ct = CTToRgb(ct);
// simple intensity correction
float brightnessPercent = (float)brightness / MatterColorTemperatureLight::MAX_BRIGHTNESS;
Expand Down Expand Up @@ -130,7 +130,10 @@ void setup() {
// This may be a restart of a already commissioned Matter accessory
if (Matter.isDeviceCommissioned()) {
Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
Serial.printf("Initial state: %s | brightness: %d | Color Temperature: %d mireds \r\n", CW_WW_Light ? "ON" : "OFF", CW_WW_Light.getBrightness(), CW_WW_Light.getColorTemperature());
Serial.printf(
"Initial state: %s | brightness: %d | Color Temperature: %d mireds \r\n", CW_WW_Light ? "ON" : "OFF", CW_WW_Light.getBrightness(),
CW_WW_Light.getColorTemperature()
);
// configure the Light based on initial on-off state and brightness
CW_WW_Light.updateAccessory();
}
Expand Down Expand Up @@ -158,7 +161,10 @@ void loop() {
Serial.println("Matter Node not commissioned yet. Waiting for commissioning.");
}
}
Serial.printf("Initial state: %s | brightness: %d | Color Temperature: %d mireds \r\n", CW_WW_Light ? "ON" : "OFF", CW_WW_Light.getBrightness(), CW_WW_Light.getColorTemperature());
Serial.printf(
"Initial state: %s | brightness: %d | Color Temperature: %d mireds \r\n", CW_WW_Light ? "ON" : "OFF", CW_WW_Light.getBrightness(),
CW_WW_Light.getColorTemperature()
);
// configure the Light based on initial on-off state and brightness
CW_WW_Light.updateAccessory();
Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

class MatterColorTemperatureLight : public MatterEndPoint {
public:
static const uint8_t MAX_BRIGHTNESS = 255;
static const uint8_t MAX_BRIGHTNESS = 255;
static const uint16_t MAX_COLOR_TEMPERATURE = 500;
static const uint16_t MIN_COLOR_TEMPERATURE = 100;
// main color temperature values
static const uint16_t COOL_WHITE_COLOR_TEMPERATURE = 142;
static const uint16_t DAYLIGHT_WHITE_COLOR_TEMPERATURE = 181;
static const uint16_t WHITE_COLOR_TEMPERATURE = 250;
static const uint16_t SOFT_WHITE_COLOR_TEMPERATURE = 370;
static const uint16_t WARM_WHITE_COLOR_TEMPERATURE = 454;
static const uint16_t COOL_WHITE_COLOR_TEMPERATURE = 142;
static const uint16_t DAYLIGHT_WHITE_COLOR_TEMPERATURE = 181;
static const uint16_t WHITE_COLOR_TEMPERATURE = 250;
static const uint16_t SOFT_WHITE_COLOR_TEMPERATURE = 370;
static const uint16_t WARM_WHITE_COLOR_TEMPERATURE = 454;

MatterColorTemperatureLight();
~MatterColorTemperatureLight();
Expand Down
Loading

0 comments on commit 3e0d084

Please sign in to comment.