zcc-helper 3.6.dev17__tar.gz → 3.6.dev19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zcc_helper-3.6.dev17/zcc_helper.egg-info → zcc_helper-3.6.dev19}/PKG-INFO +1 -1
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/constants.py +1 -1
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/device.py +9 -4
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19/zcc_helper.egg-info}/PKG-INFO +1 -1
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/LICENSE.txt +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/README.md +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/setup.cfg +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/setup.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/tests/test_device.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/__init__.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/__main__.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/controller.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/description.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/discovery.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/errors.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/manufacture_info.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/protocol.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/socket.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/trace.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc/watchdog.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc.py +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc_helper.egg-info/SOURCES.txt +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc_helper.egg-info/dependency_links.txt +0 -0
- {zcc_helper-3.6.dev17 → zcc_helper-3.6.dev19}/zcc_helper.egg-info/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@ from pprint import pformat
|
|
|
9
9
|
from zcc.errors import ControlPointError
|
|
10
10
|
from zcc.manufacture_info import ControlPointManufactureInfo
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
OPEN_AND_CLOSE_TOLERANCE = 5
|
|
13
13
|
OPEN_AND_CLOSE_WORKAROUND = True
|
|
14
14
|
|
|
15
15
|
|
|
@@ -170,6 +170,8 @@ class ControlPointDevice:
|
|
|
170
170
|
@property
|
|
171
171
|
def is_closing(self) -> bool:
|
|
172
172
|
"""Returns True if door is closing."""
|
|
173
|
+
if abs(self.percentage - self._target_percentage) <= OPEN_AND_CLOSE_TOLERANCE:
|
|
174
|
+
return False
|
|
173
175
|
if self.percentage and self._target_percentage:
|
|
174
176
|
return self.percentage > self._target_percentage and not self.is_closed
|
|
175
177
|
return False
|
|
@@ -179,7 +181,7 @@ class ControlPointDevice:
|
|
|
179
181
|
"""Returns True if door is closed."""
|
|
180
182
|
|
|
181
183
|
if self.percentage:
|
|
182
|
-
return self.percentage <=
|
|
184
|
+
return self.percentage <= OPEN_AND_CLOSE_TOLERANCE
|
|
183
185
|
return True
|
|
184
186
|
|
|
185
187
|
@property
|
|
@@ -212,7 +214,8 @@ class ControlPointDevice:
|
|
|
212
214
|
@property
|
|
213
215
|
def is_opening(self) -> bool:
|
|
214
216
|
"""Returns True if door is opening and is NOT already open."""
|
|
215
|
-
|
|
217
|
+
if abs(self.percentage - self._target_percentage) <= OPEN_AND_CLOSE_TOLERANCE:
|
|
218
|
+
return False
|
|
216
219
|
if self.percentage and self._target_percentage:
|
|
217
220
|
return self.percentage < self._target_percentage and not self.is_open
|
|
218
221
|
return False
|
|
@@ -222,7 +225,7 @@ class ControlPointDevice:
|
|
|
222
225
|
"""Returns True if door is open."""
|
|
223
226
|
|
|
224
227
|
if self.percentage:
|
|
225
|
-
return self.percentage >= 100 -
|
|
228
|
+
return self.percentage >= 100 - OPEN_AND_CLOSE_TOLERANCE
|
|
226
229
|
return False
|
|
227
230
|
|
|
228
231
|
@property
|
|
@@ -257,6 +260,8 @@ class ControlPointDevice:
|
|
|
257
260
|
|
|
258
261
|
async def open_to_percentage(self, percentage):
|
|
259
262
|
"""OpenToPercentage if the action is supported"""
|
|
263
|
+
if OPEN_AND_CLOSE_WORKAROUND and percentage == 0:
|
|
264
|
+
percentage = 1
|
|
260
265
|
self._target_percentage = percentage
|
|
261
266
|
await self.__action(
|
|
262
267
|
"OpenToPercentage", params={"openpercentage": int(percentage)}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|