Negative values raise an AssertionError as expected:
>>> light.set_light_level(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.local/lib/python3.11/site-packages/dirigera/devices/light.py", line 73, in set_light_level
raise AssertionError("light_level must be a value between 0 and 100")
AssertionError: light_level must be a value between 0 and 100
Zero should be ok according to the error message but raises an HTTPError:
>>> light.set_light_level(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.local/lib/python3.11/site-packages/dirigera/devices/light.py", line 76, in set_light_level
self.dirigera_client.patch(route=f"/devices/{self.device_id}", data=data)
File "/home/user/.local/lib/python3.11/site-packages/dirigera/hub/hub.py", line 78, in patch
response.raise_for_status()
File "/home/user/.local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://xxx.xxx.xxx.xxx:8443/v1/devices/...
Negative values raise an AssertionError as expected:
https://github.com/Leggin/dirigera/blob/192a8483051e821ba3514e53e1b1715c6bf1239b/src/dirigera/devices/light.py#L72-L73
Zero should be ok according to the error message but raises an HTTPError:
One and above work as expected: