pypck 0.8.7__tar.gz → 0.8.9__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.
- {pypck-0.8.7/pypck.egg-info → pypck-0.8.9}/PKG-INFO +1 -1
- pypck-0.8.9/VERSION +1 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/inputs.py +1 -1
- {pypck-0.8.7 → pypck-0.8.9}/pypck/module.py +5 -2
- {pypck-0.8.7 → pypck-0.8.9}/pypck/pck_commands.py +5 -3
- {pypck-0.8.7 → pypck-0.8.9/pypck.egg-info}/PKG-INFO +1 -1
- {pypck-0.8.7 → pypck-0.8.9}/tests/test_commands.py +6 -2
- {pypck-0.8.7 → pypck-0.8.9}/tests/test_messages.py +2 -2
- pypck-0.8.7/VERSION +0 -1
- {pypck-0.8.7 → pypck-0.8.9}/LICENSE +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/README.md +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/__init__.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/connection.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/helpers.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/lcn_addr.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/lcn_defs.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/request_handlers.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck/timeout_retry.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck.egg-info/SOURCES.txt +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck.egg-info/dependency_links.txt +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck.egg-info/not-zip-safe +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pypck.egg-info/top_level.txt +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/pyproject.toml +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/setup.cfg +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/tests/test_connection.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/tests/test_dyn_text.py +0 -0
- {pypck-0.8.7 → pypck-0.8.9}/tests/test_vars.py +0 -0
pypck-0.8.9/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.8.9
|
|
@@ -174,19 +174,22 @@ class AbstractConnection:
|
|
|
174
174
|
self.wants_ack, PckGenerator.rel_output(output_id, percent)
|
|
175
175
|
)
|
|
176
176
|
|
|
177
|
-
async def toggle_output(
|
|
177
|
+
async def toggle_output(
|
|
178
|
+
self, output_id: int, ramp: int, to_memory: bool = False
|
|
179
|
+
) -> bool:
|
|
178
180
|
"""Send a command that toggles a single output-port.
|
|
179
181
|
|
|
180
182
|
Toggle mode: (on->off, off->on).
|
|
181
183
|
|
|
182
184
|
:param int output_id: Output id 0..3
|
|
183
185
|
:param int ramp: Ramp time in milliseconds
|
|
186
|
+
:param bool to_memory: If True, the dimming status is stored
|
|
184
187
|
|
|
185
188
|
:returns: True if command was sent successfully, False otherwise
|
|
186
189
|
:rtype: bool
|
|
187
190
|
"""
|
|
188
191
|
return await self.send_command(
|
|
189
|
-
self.wants_ack, PckGenerator.toggle_output(output_id, ramp)
|
|
192
|
+
self.wants_ack, PckGenerator.toggle_output(output_id, ramp, to_memory)
|
|
190
193
|
)
|
|
191
194
|
|
|
192
195
|
async def toggle_all_outputs(self, ramp: int) -> bool:
|
|
@@ -471,19 +471,21 @@ class PckGenerator:
|
|
|
471
471
|
return pck
|
|
472
472
|
|
|
473
473
|
@staticmethod
|
|
474
|
-
def toggle_output(output_id: int, ramp: int) -> str:
|
|
474
|
+
def toggle_output(output_id: int, ramp: int, to_memory: bool = False) -> str:
|
|
475
475
|
"""Generate a command that toggles a single output-port.
|
|
476
476
|
|
|
477
477
|
Toggle mode: (on->off, off->on).
|
|
478
478
|
|
|
479
479
|
:param int output_id: Output id 0..3
|
|
480
480
|
:param int ramp: Ramp value
|
|
481
|
+
:param bool to_memory: If True, the dimming status is stored
|
|
482
|
+
|
|
481
483
|
:return: The PCK command (without address header) as text
|
|
482
484
|
:rtype: str
|
|
483
485
|
"""
|
|
484
486
|
if (output_id < 0) or (output_id > 3):
|
|
485
487
|
raise ValueError("Invalid output_id.")
|
|
486
|
-
return f"A{output_id + 1}TA{ramp:03d}"
|
|
488
|
+
return f"A{output_id + 1}{'MT' if to_memory else 'TA'}{ramp:03d}"
|
|
487
489
|
|
|
488
490
|
@staticmethod
|
|
489
491
|
def toggle_all_outputs(ramp: int) -> str:
|
|
@@ -645,7 +647,7 @@ class PckGenerator:
|
|
|
645
647
|
return f"R8M{new_motor_id}{action}"
|
|
646
648
|
elif mode == lcn_defs.MotorPositioningMode.MODULE:
|
|
647
649
|
new_motor_id = 1 << motor_id
|
|
648
|
-
return f"JH{position:03d}{new_motor_id:03d}"
|
|
650
|
+
return f"JH{100 - position:03d}{new_motor_id:03d}"
|
|
649
651
|
|
|
650
652
|
return ""
|
|
651
653
|
|
|
@@ -165,6 +165,10 @@ COMMANDS = {
|
|
|
165
165
|
f"A{output + 1:d}TA123": (PckGenerator.toggle_output, output, 123)
|
|
166
166
|
for output in range(4)
|
|
167
167
|
},
|
|
168
|
+
**{
|
|
169
|
+
f"A{output + 1:d}MT123": (PckGenerator.toggle_output, output, 123, True)
|
|
170
|
+
for output in range(4)
|
|
171
|
+
},
|
|
168
172
|
"AU123": (PckGenerator.toggle_all_outputs, 123),
|
|
169
173
|
# Relay state manipulation
|
|
170
174
|
"R80-1U1-U0": (
|
|
@@ -254,10 +258,10 @@ COMMANDS = {
|
|
|
254
258
|
50,
|
|
255
259
|
MotorPositioningMode.MODULE,
|
|
256
260
|
),
|
|
257
|
-
"
|
|
261
|
+
"JH030004": (
|
|
258
262
|
PckGenerator.control_motor_relays_position,
|
|
259
263
|
2,
|
|
260
|
-
|
|
264
|
+
70,
|
|
261
265
|
MotorPositioningMode.MODULE,
|
|
262
266
|
),
|
|
263
267
|
"X2001228000": (
|
pypck-0.8.7/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.8.7
|
|
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
|