conson-xp 1.35.0__py3-none-any.whl → 1.36.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: conson-xp
3
- Version: 1.35.0
3
+ Version: 1.36.0
4
4
  Summary: XP Protocol Communication Tools
5
5
  Author-Email: ldvchosal <ldvchosal@github.com>
6
6
  License: MIT License
@@ -1,8 +1,8 @@
1
- conson_xp-1.35.0.dist-info/METADATA,sha256=-Lw1Rw_5jRvY22Z8moRh9N31dx9EuzV7qQ8oZeW_7Og,11246
2
- conson_xp-1.35.0.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
3
- conson_xp-1.35.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
4
- conson_xp-1.35.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
5
- xp/__init__.py,sha256=UiuNf-HRLrftHgahYFnTtw0rkyT8zacWREPahcTjY3Q,181
1
+ conson_xp-1.36.0.dist-info/METADATA,sha256=yAI8M5UPAq9YeW27pMskQLgX_CehBjANMIhDqaEm1JQ,11246
2
+ conson_xp-1.36.0.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
3
+ conson_xp-1.36.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
4
+ conson_xp-1.36.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
5
+ xp/__init__.py,sha256=5SwVHk5WNEf2f5aDU_P09Qax6p3E4JqdZGNWOOqOQq4,181
6
6
  xp/cli/__init__.py,sha256=QjnKB1KaI2aIyKlzrnvCwfbBuUj8HNgwNMvNJVQofbI,81
7
7
  xp/cli/__main__.py,sha256=l2iKwMdat5rTGd3JWs-uGksnYYDDffp_Npz05QdKEeU,117
8
8
  xp/cli/commands/__init__.py,sha256=noh8fdZAWq-ihJEboP8WugbIgq4LJ3jUWMRA7720xWE,4909
@@ -185,7 +185,7 @@ xp/services/telegram/telegram_service.py,sha256=XrP1CPi0ckxoKBaNwLA6lo-TogWxXgmX
185
185
  xp/services/telegram/telegram_version_service.py,sha256=M5HdOTsLdcwo122FP-jW6R740ktLrtKf2TiMDVz23h8,10528
186
186
  xp/services/term/__init__.py,sha256=BIeOK042bMR-0l6MA80wdW5VuHlpWOXtRER9IG5ilQA,245
187
187
  xp/services/term/protocol_monitor_service.py,sha256=PhEzLNzWf1XieQw94ua-hJu9ccwrAzhdxSZGe4kHghs,9945
188
- xp/services/term/state_monitor_service.py,sha256=PgwCH8nce1RODV33aJefiX3on-pSGEgP_4FDAoU5Trc,16218
188
+ xp/services/term/state_monitor_service.py,sha256=PYKiPO4Zijc-DApRECTIChnbdsOFT3Ndc1MsBglekts,16961
189
189
  xp/term/__init__.py,sha256=Xg2DhBeI3xQJLfc7_BPWI1por-rUXemyer5OtOt9Cus,51
190
190
  xp/term/protocol.py,sha256=oLJAExvIaOSpy75A5TaYB_7R9skTTtNtPx8hiJLdy_U,3425
191
191
  xp/term/protocol.tcss,sha256=r_KfxrbpycGHLVXqZc6INBBcUJME0hLrAZkF1oqnab4,2126
@@ -193,7 +193,7 @@ xp/term/state.py,sha256=sR7I6t4gJSkO2YS3TwonAnGPR_f43coCk4xKdWETus0,3233
193
193
  xp/term/state.tcss,sha256=Njp7fc16cCunLq7hi5RvXjPi4jSCGi5aPDnusb9dq1Y,1401
194
194
  xp/term/widgets/__init__.py,sha256=ftWmN_fmjxy2E8Qfm-YSRmzKfgL0KTBCTpgvYWCPbUY,274
195
195
  xp/term/widgets/help_menu.py,sha256=w2NjwiC_s16St0rigZ9ef9S0V9Y4v0J5eCVCHAdRKF4,1789
196
- xp/term/widgets/modules_list.py,sha256=DD0PUnY4gv05hkCVxThWULHg1ZNNY8xr1XFaZrv9kS4,7666
196
+ xp/term/widgets/modules_list.py,sha256=cZlrHhse9onSZGBeJe9tuByWCk-928bsmUBGNeXiF2I,7745
197
197
  xp/term/widgets/protocol_log.py,sha256=CJUpckWj7GC1kVqixDadteyGnI4aHyzd4kkH-pSbzno,2600
198
198
  xp/term/widgets/status_footer.py,sha256=bxrcqKzJ9V0aPSn_WwraVpJz7NxBUh3yIjA3fwv5nVA,3256
199
199
  xp/utils/__init__.py,sha256=_avMF_UOkfR3tNeDIPqQ5odmbq5raKkaq1rZ9Cn1CJs,332
@@ -204,4 +204,4 @@ xp/utils/logging.py,sha256=rZDXwlBrYK8A6MPq5StsMNpgsRowzJXM6fvROPwJdGM,3750
204
204
  xp/utils/serialization.py,sha256=RWHHk86feaB4ZP7rjE4qOWK0900yg2joUBDkP76gfOY,4618
205
205
  xp/utils/state_machine.py,sha256=Oe2sLwCh9z_vr1tF6X0ZRGTeuckRQAGzmef7xc9CNdc,2413
206
206
  xp/utils/time_utils.py,sha256=dEyViDlAG9GWU-J3D_YVa-sGma6yiyyMTgN4h2x3PY4,3781
207
- conson_xp-1.35.0.dist-info/RECORD,,
207
+ conson_xp-1.36.0.dist-info/RECORD,,
xp/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  conson-xp package.
4
4
  """
5
5
 
6
- __version__ = "1.35.0"
6
+ __version__ = "1.36.0"
7
7
  __manufacturer__ = "salchichon"
8
8
  __model__ = "xp.cli"
9
9
  __serial__ = "2025.09.23.000"
@@ -321,7 +321,7 @@ class StateMonitorService:
321
321
 
322
322
  Args:
323
323
  module_state: Module state to update.
324
- output_number: Output number (0-3 for XP24).
324
+ output_number: Output number (0-3 for XP24, 0-2 for XP33 modules).
325
325
  output_state: True for ON, False for OFF.
326
326
  """
327
327
  # Parse existing outputs string "0 1 0 0" → [0, 1, 0, 0]
@@ -340,8 +340,9 @@ class StateMonitorService:
340
340
  def _handle_event_telegram(self, event: TelegramReceivedEvent) -> None:
341
341
  """Handle event telegram for output state changes.
342
342
 
343
- Processes XP24 output event telegrams to update module state in real-time.
344
- Output events use input_number field with values 80-83 to represent outputs 0-3.
343
+ Processes XP24 and XP33 output event telegrams to update module state in real-time.
344
+ - XP24 output events use input_number 80-83 to represent outputs 0-3.
345
+ - XP33 output events use input_number 0-2 to represent channels 0-2.
345
346
 
346
347
  Args:
347
348
  event: Telegram received event containing event telegram.
@@ -352,17 +353,37 @@ class StateMonitorService:
352
353
  self.logger.debug("Failed to parse event telegram")
353
354
  return
354
355
 
355
- # Only process XP24 output events
356
- if event_telegram.module_type != ModuleTypeCode.XP24.value:
357
- self.logger.debug(
358
- f"Ignoring event from module type {event_telegram.module_type}"
359
- )
360
- return
356
+ # Determine output number based on module type
357
+ output_number = None
358
+
359
+ if event_telegram.module_type == ModuleTypeCode.XP24.value:
360
+ # XP24 uses input_number 80-83 for outputs 0-3
361
+ if 80 <= event_telegram.input_number <= 83:
362
+ output_number = event_telegram.input_number - 80
363
+ else:
364
+ self.logger.debug(
365
+ f"Ignoring XP24 input event I{event_telegram.input_number:02d}"
366
+ )
367
+ return
361
368
 
362
- # Validate output number range (80-83 for XP24 outputs 0-3)
363
- if not (80 <= event_telegram.input_number <= 83):
369
+ elif event_telegram.module_type in (
370
+ ModuleTypeCode.XP33.value,
371
+ ModuleTypeCode.XP33LR.value,
372
+ ModuleTypeCode.XP33LED.value,
373
+ ):
374
+ # XP33 modules use input_number 0-2 for channels 0-2
375
+ if 80 <= event_telegram.input_number <= 82:
376
+ output_number = event_telegram.input_number - 80
377
+ else:
378
+ self.logger.debug(
379
+ f"Ignoring XP33 input event I{event_telegram.input_number:02d}"
380
+ )
381
+ return
382
+
383
+ else:
384
+ # Ignore events from other module types
364
385
  self.logger.debug(
365
- f"Ignoring input event I{event_telegram.input_number:02d}"
386
+ f"Ignoring event from module type {event_telegram.module_type}"
366
387
  )
367
388
  return
368
389
 
@@ -374,9 +395,8 @@ class StateMonitorService:
374
395
  )
375
396
  return
376
397
 
377
- # Convert input_number to output_number (80→0, 81→1, 82→2, 83→3)
378
- output_number = event_telegram.input_number - 80
379
- output_state = event_telegram.is_button_press # M=True, B=False
398
+ # Determine output state (M=True/ON, B=False/OFF)
399
+ output_state = event_telegram.is_button_press
380
400
 
381
401
  # Update output state
382
402
  self._update_output_bit(module_state, output_number, output_state)
@@ -111,7 +111,9 @@ class ModulesListWidget(Static):
111
111
  # Update existing row
112
112
  row_key = self._row_keys[serial_number]
113
113
  self.table.update_cell(
114
- row_key, "outputs", self._format_outputs(module_state.outputs)
114
+ row_key,
115
+ "outputs",
116
+ Text(self._format_outputs(module_state.outputs), justify="right"),
115
117
  )
116
118
  self.table.update_cell(
117
119
  row_key,
@@ -144,7 +146,7 @@ class ModulesListWidget(Static):
144
146
  Text(str(module_state.link_number), justify="right"),
145
147
  module_state.serial_number,
146
148
  module_state.module_type,
147
- self._format_outputs(module_state.outputs),
149
+ Text(self._format_outputs(module_state.outputs), justify="right"),
148
150
  Text(self._format_report(module_state.auto_report), justify="center"),
149
151
  module_state.error_status,
150
152
  Text(self._format_last_update(module_state.last_update), justify="center"),