Skip to content

Commit

Permalink
Merge pull request #21 from benteg/fix-set-light-level
Browse files Browse the repository at this point in the history
fix light level check in set_light_level function
  • Loading branch information
Leggin authored Jun 11, 2023
2 parents e0ad3bf + 307a14b commit 13d6e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dirigera/devices/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def set_light_level(self, light_level: int) -> None:
raise AssertionError(
"This lamp does not support the set lightLevel function"
)
if light_level < 0 or light_level > 100:
raise AssertionError("light_level must be a value between 0 and 100")
if light_level < 1 or light_level > 100:
raise AssertionError("light_level must be a value between 1 and 100")

data = [{"attributes": {"lightLevel": light_level}}]
self.dirigera_client.patch(route=f"/devices/{self.device_id}", data=data)
Expand Down

0 comments on commit 13d6e93

Please sign in to comment.