Skip to content
Snippets Groups Projects
Unverified Commit 1f86a0a7 authored by Poltorak Serguei's avatar Poltorak Serguei Committed by GitHub
Browse files

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
parent dfa9f0e1
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment