mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
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
@ -73,8 +73,23 @@ class ZWaveMeCover(ZWaveMeEntity, CoverEntity):
|
|||||||
"""Return current position of cover.
|
"""Return current position of cover.
|
||||||
|
|
||||||
None is unknown, 0 is closed, 100 is fully open.
|
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 100
|
||||||
|
|
||||||
return self.device.level
|
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…
x
Reference in New Issue
Block a user