Update deconz/cover.py to adapt rest-api changes (#32351)

* Update cover.py to adapt rest-api changes

* adjust test to reflect max brightness changes

* implement test for rest-api cover position of 255
This commit is contained in:
Knapoc authored and GitHub committed 2020-03-16 15:44:59 +01:00
1 parent 8d68f34650
commit 7ec7306ea8
2 files changed
+32 -6

No files matched your search

+2 -2
View File
@@ -61,7 +61,7 @@ class DeconzCover(DeconzDevice, CoverDevice):
@property
def current_cover_position(self):
"""Return the current position of the cover."""
return 100 - int(self._device.brightness / 255 * 100)
return 100 - int(self._device.brightness / 254 * 100)
@property
def is_closed(self):
@@ -88,7 +88,7 @@ class DeconzCover(DeconzDevice, CoverDevice):
if position < 100:
data["on"] = True
data["bri"] = 255 - int(position / 100 * 255)
data["bri"] = 254 - int(position / 100 * 254)
await self._device.async_set_state(data)