pypck 0.8.8__py3-none-any.whl → 0.8.9__py3-none-any.whl

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/module.py CHANGED
@@ -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(self, output_id: int, ramp: int) -> bool:
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:
pypck/pck_commands.py CHANGED
@@ -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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypck
3
- Version: 0.8.8
3
+ Version: 0.8.9
4
4
  Summary: LCN-PCK library
5
5
  Home-page: https://github.com/alengwenus/pypck
6
6
  Author-email: Andre Lengwenus <alengwenus@gmail.com>
@@ -4,12 +4,12 @@ pypck/helpers.py,sha256=hEGId1pQ4wOJgIwNKDx17qKBlxvNxvspSrI0gSY3wCQ,1267
4
4
  pypck/inputs.py,sha256=cjhvYKPr5QHw7Rjfkkg8LPbP8ohq_-z_Tvk51Rkx0aY,45828
5
5
  pypck/lcn_addr.py,sha256=N2Od8KuANOglqKjf596hJVH1SRcG7MhESKA5YYlDnbw,1946
6
6
  pypck/lcn_defs.py,sha256=UffOX1s2856MXRgc3dv6SzSPGze4IiSk_sT-PpWTva8,41741
7
- pypck/module.py,sha256=SBKfblaGYvYBp-gzvnn606W6eJy-ICTGzA7KxNvllgk,38349
8
- pypck/pck_commands.py,sha256=uG57j-Ju9JzKeglYYxk5hiBjFA9aSsSDSzNhZ2b1TWA,50250
7
+ pypck/module.py,sha256=bRXIVQjaBr6Gfs_xYMMDeTZAle86M-nm6YfzyTjs7kA,38476
8
+ pypck/pck_commands.py,sha256=bkb3q49s4PVY6UNR0B6S31oU7aSaEbpPl3rj0eGxTQU,50380
9
9
  pypck/request_handlers.py,sha256=mGwM4_jpVpTxTQ7kgkEa_PYgliTm-omtzEf3LcIdpD8,25222
10
10
  pypck/timeout_retry.py,sha256=FzeoyhmA4Tj13wR4kGXUwH8HyXnZ1RQOAYY9sSbz6rw,3859
11
- pypck-0.8.8.dist-info/licenses/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023
12
- pypck-0.8.8.dist-info/METADATA,sha256=LrK3YHB8d5iIj6wbHj_Kr7cDhgiJyQVsJGRcm_tzPJM,5603
13
- pypck-0.8.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- pypck-0.8.8.dist-info/top_level.txt,sha256=59ried49iFueDa5mQ_5BGVZcESjjzi4MZZKLcganvQA,6
15
- pypck-0.8.8.dist-info/RECORD,,
11
+ pypck-0.8.9.dist-info/licenses/LICENSE,sha256=iYB6zyMJvShfAzQE7nhYFgLzzZuBmhasLw5fYP9KRz4,1023
12
+ pypck-0.8.9.dist-info/METADATA,sha256=uKj_Xrr-oOGPjBfZhsb7sebFTQuDlPmcaZcNyahkOck,5603
13
+ pypck-0.8.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ pypck-0.8.9.dist-info/top_level.txt,sha256=59ried49iFueDa5mQ_5BGVZcESjjzi4MZZKLcganvQA,6
15
+ pypck-0.8.9.dist-info/RECORD,,
File without changes