Z-Wave.Me: Cover: Fixed calibration errors and add missing is_closed (#85452)
* Cover: Fixed calibration errors and add missing is_closed * Style * Style * whitespace
This commit is contained in:
parent
dfa9f0e11d
commit
1f86a0a76f
1 changed files with 16 additions and 1 deletions
|
@ -73,8 +73,23 @@ class ZWaveMeCover(ZWaveMeEntity, CoverEntity):
|
|||
"""Return current position of cover.
|
||||
|
||||
None is unknown, 0 is closed, 100 is fully open.
|
||||
|
||||
Allow small calibration errors (some devices after a long time become not well calibrated)
|
||||
"""
|
||||
if self.device.level == 99: # Scale max value
|
||||
if self.device.level > 95:
|
||||
return 100
|
||||
|
||||
return self.device.level
|
||||
|
||||
@property
|
||||
def is_closed(self) -> bool | None:
|
||||
"""Return true if cover is closed.
|
||||
|
||||
None is unknown.
|
||||
|
||||
Allow small calibration errors (some devices after a long time become not well calibrated)
|
||||
"""
|
||||
if self.device.level is None:
|
||||
return None
|
||||
|
||||
return self.device.level < 5
|
||||
|
|
Loading…
Add table
Reference in a new issue