Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/dirigera/devices/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def set_color_temperature(self, color_temp: int) -> None:
):
raise ValueError("Values of color_temp_max or color_temp_min are None")
if (
color_temp < self.attributes.color_temperature_max
or color_temp > self.attributes.color_temperature_min
color_temp < self.attributes.color_temperature_min
or color_temp > self.attributes.color_temperature_max
):
raise ValueError(
"color_temperature must be a value between "
f"{self.attributes.color_temperature_max} and {self.attributes.color_temperature_min}"
f"{self.attributes.color_temperature_min} and {self.attributes.color_temperature_max}"
)

data = [{"attributes": {"colorTemperature": color_temp}}]
Expand Down
12 changes: 6 additions & 6 deletions tests/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def fixture_light(fake_client: FakeDirigeraHub) -> Light:
"startupOnOff": "startOff",
"lightLevel": 43,
"colorTemperature": 2222,
"colorTemperatureMin": 4000,
"colorTemperatureMax": 2202,
"colorTemperatureMin": 2202,
"colorTemperatureMax": 4000,
"startupTemperature": -1,
"colorHue": 200,
"colorSaturation": 0.7,
Expand Down Expand Up @@ -87,8 +87,8 @@ def test_refresh(fake_light: Light, fake_client: FakeDirigeraHub) -> None:
"isOn": False,
"lightLevel": 13,
"colorTemperature": 2222,
"colorTemperatureMin": 4000,
"colorTemperatureMax": 2202,
"colorTemperatureMin": 2202,
"colorTemperatureMax": 4000,
"colorHue": 100,
"colorSaturation": 0.8,
"startupTemperature": -1,
Expand Down Expand Up @@ -274,8 +274,8 @@ def test_dict_to_light_3rdparty(fake_client: FakeDirigeraHub) -> None:
"isOn": False,
"lightLevel": 100,
"colorTemperature": 2710,
"colorTemperatureMin": 4000,
"colorTemperatureMax": 2202,
"colorTemperatureMin": 2202,
"colorTemperatureMax": 4000,
"colorMode": "temperature",
"identifyStarted": "2000-01-01T00:00:00.000Z",
"identifyPeriod": 0,
Expand Down