conson-xp 1.38.0__py3-none-any.whl → 1.39.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.38.0
3
+ Version: 1.39.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.38.0.dist-info/METADATA,sha256=BaKGH6wo1T_TGXTUMPeRF-CSqfebxBULEpiM22sCi_w,11330
2
- conson_xp-1.38.0.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
3
- conson_xp-1.38.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
4
- conson_xp-1.38.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
5
- xp/__init__.py,sha256=5fakKUk2esOx8vUfRq1ASPbUSI7FQDe4PEnmW5Z2KOw,181
1
+ conson_xp-1.39.0.dist-info/METADATA,sha256=ZnnTqw5hdtgrYNryR8of7kj7-8cD0Hy5GB4h_syNtok,11330
2
+ conson_xp-1.39.0.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
3
+ conson_xp-1.39.0.dist-info/entry_points.txt,sha256=1OcdIcDM1hz3ljCXgybaPUh1IOFEwkaTgLIW9u9zGeg,50
4
+ conson_xp-1.39.0.dist-info/licenses/LICENSE,sha256=rxj6woMM-r3YCyGq_UHFtbh7kHTAJgrccH6O-33IDE4,1419
5
+ xp/__init__.py,sha256=XLd0Ey5N2BokGf5bKHhDEB2BpUIExFL_W41vN72w-Ko,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=G7A1KFRSV0CEeDTqr_khu-K9_sc01CTI2KSfkFcaBRM,4949
@@ -55,14 +55,12 @@ xp/cli/utils/module_type_choice.py,sha256=TPIEDsO0fNDu2HOQQ16WCJ-a7o2f58j3IKd8B0
55
55
  xp/cli/utils/serial_number_type.py,sha256=GUs3jtVI6EVulvt6fCDN6H6vxhiJwdMmdIvLjDlGGZ4,1466
56
56
  xp/cli/utils/system_function_choice.py,sha256=0J02EMgAQcsrE-9rEkv6YHelBoBkZ73T8VLBSm6YO5k,1623
57
57
  xp/cli/utils/xp_module_type.py,sha256=qSFJBRceqPi_cUFPxAWtLUNq37-KwUEjo9ekYOj7kLQ,1471
58
- xp/connection/__init__.py,sha256=ClJsVWALYZgAGYZK_Jznd3YKLrHDu17kBfwugjuPfu0,209
59
- xp/connection/exceptions.py,sha256=7CcRUzkyay5zA6Z9-5dIDRzua806v5N7pCcJazP_1dE,365
60
58
  xp/models/__init__.py,sha256=lROqr559DGd8WpJJUtfPT95VERCwMZHpBDEc96QSxQ0,1312
61
59
  xp/models/actiontable/__init__.py,sha256=6kVq1rTOlpc24sZxGGVWkY48tqR42YWHLQHqakWqlPc,43
62
60
  xp/models/actiontable/actiontable.py,sha256=bIeluZhMsvukkSwy2neaewavU8YR6Pso3PIvJ8ENlGg,1251
63
61
  xp/models/actiontable/msactiontable.py,sha256=42RdQB3rUzAP_UeH5PS6iADOnkev47rDR77_yttSkBg,192
64
62
  xp/models/actiontable/msactiontable_xp20.py,sha256=iMNKrDpLcaynaG1pflfyoQjey-KUsoSjqy4J4XF-YGk,2031
65
- xp/models/actiontable/msactiontable_xp24.py,sha256=hGi8Ah9LdL1w6bTLR8SUJVS_UA9PoB_Bzudv72A1AiU,9722
63
+ xp/models/actiontable/msactiontable_xp24.py,sha256=yYaWS7VRr2EyLXozfoJWLmgQmMU9dGo81V4VU4q6cUo,9464
66
64
  xp/models/actiontable/msactiontable_xp33.py,sha256=K1noQe5TNoTFLWE58r0-ZOB8lYM3oXFqoNL7z7Uob5A,2945
67
65
  xp/models/conbus/__init__.py,sha256=VIusMWQdBtlwDgj7oSj06wQkklihTp4oWFShvP_JUgA,35
68
66
  xp/models/conbus/conbus.py,sha256=mZQzKPfrdttT-qUnYUSyrEYyc_eHs8z301E5ejeiyvk,2689
@@ -209,4 +207,4 @@ xp/utils/logging.py,sha256=rZDXwlBrYK8A6MPq5StsMNpgsRowzJXM6fvROPwJdGM,3750
209
207
  xp/utils/serialization.py,sha256=RWHHk86feaB4ZP7rjE4qOWK0900yg2joUBDkP76gfOY,4618
210
208
  xp/utils/state_machine.py,sha256=Oe2sLwCh9z_vr1tF6X0ZRGTeuckRQAGzmef7xc9CNdc,2413
211
209
  xp/utils/time_utils.py,sha256=dEyViDlAG9GWU-J3D_YVa-sGma6yiyyMTgN4h2x3PY4,3781
212
- conson_xp-1.38.0.dist-info/RECORD,,
210
+ conson_xp-1.39.0.dist-info/RECORD,,
xp/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  conson-xp package.
4
4
  """
5
5
 
6
- __version__ = "1.38.0"
6
+ __version__ = "1.39.0"
7
7
  __manufacturer__ = "salchichon"
8
8
  __model__ = "xp.cli"
9
9
  __serial__ = "2025.09.23.000"
@@ -159,14 +159,11 @@ class Xp24MsActionTable(MsActionTable):
159
159
  curtain34: bool = False # Curtain setting for inputs 3-4
160
160
  mutual_deadtime: int = MS300 # Master timing (MS300=12 or MS500=20)
161
161
 
162
- def to_short_format(self, include_settings: bool = False) -> str:
162
+ def to_short_format(self) -> str:
163
163
  """Convert action table to short format string.
164
164
 
165
- Args:
166
- include_settings: Include settings after pipe separator.
167
-
168
165
  Returns:
169
- Short format string (e.g., "XP24 T:1 T:2 T:0 T:0").
166
+ Short format string with settings (e.g., "XP24 T:1 T:2 T:0 T:0 | M12:0 M34:0 C12:0 C34:0 DT:12").
170
167
  """
171
168
  # Format input actions
172
169
  actions = [
@@ -184,16 +181,15 @@ class Xp24MsActionTable(MsActionTable):
184
181
 
185
182
  result = f"XP24 {' '.join(action_parts)}"
186
183
 
187
- # Add settings if requested
188
- if include_settings:
189
- settings = (
190
- f"M12:{1 if self.mutex12 else 0} "
191
- f"M34:{1 if self.mutex34 else 0} "
192
- f"C12:{1 if self.curtain12 else 0} "
193
- f"C34:{1 if self.curtain34 else 0} "
194
- f"DT:{self.mutual_deadtime}"
195
- )
196
- result = f"{result} | {settings}"
184
+ # Add settings
185
+ settings = (
186
+ f"M12:{1 if self.mutex12 else 0} "
187
+ f"M34:{1 if self.mutex34 else 0} "
188
+ f"C12:{1 if self.curtain12 else 0} "
189
+ f"C34:{1 if self.curtain34 else 0} "
190
+ f"DT:{self.mutual_deadtime}"
191
+ )
192
+ result = f"{result} | {settings}"
197
193
 
198
194
  return result
199
195
 
@@ -213,7 +209,7 @@ class Xp24MsActionTable(MsActionTable):
213
209
  # Split by pipe to separate actions from settings
214
210
  parts = short_str.split("|")
215
211
  action_part = parts[0].strip()
216
- settings_part = parts[1].strip() if len(parts) > 1 else None
212
+ settings_part = parts[1].strip()
217
213
 
218
214
  # Parse action part
219
215
  tokens = action_part.split()
@@ -253,23 +249,22 @@ class Xp24MsActionTable(MsActionTable):
253
249
  "input4_action": input_actions[3],
254
250
  }
255
251
 
256
- if settings_part:
257
- # Parse settings: M12:0 M34:1 C12:0 C34:1 DT:12
258
- for setting in settings_part.split():
259
- if ":" not in setting:
260
- continue
261
-
262
- key, value = setting.split(":", 1)
263
-
264
- if key == "M12":
265
- kwargs["mutex12"] = value == "1"
266
- elif key == "M34":
267
- kwargs["mutex34"] = value == "1"
268
- elif key == "C12":
269
- kwargs["curtain12"] = value == "1"
270
- elif key == "C34":
271
- kwargs["curtain34"] = value == "1"
272
- elif key == "DT":
273
- kwargs["mutual_deadtime"] = int(value)
252
+ # Parse settings: M12:0 M34:1 C12:0 C34:1 DT:12
253
+ for setting in settings_part.split():
254
+ if ":" not in setting:
255
+ continue
256
+
257
+ key, value = setting.split(":", 1)
258
+
259
+ if key == "M12":
260
+ kwargs["mutex12"] = value == "1"
261
+ elif key == "M34":
262
+ kwargs["mutex34"] = value == "1"
263
+ elif key == "C12":
264
+ kwargs["curtain12"] = value == "1"
265
+ elif key == "C34":
266
+ kwargs["curtain34"] = value == "1"
267
+ elif key == "DT":
268
+ kwargs["mutual_deadtime"] = int(value)
274
269
 
275
270
  return cls(**kwargs)
xp/connection/__init__.py DELETED
@@ -1,13 +0,0 @@
1
- """Connection layer for XP CLI tool."""
2
-
3
- from xp.connection.exceptions import (
4
- ProtocolError,
5
- ValidationError,
6
- XPError,
7
- )
8
-
9
- __all__ = [
10
- "XPError",
11
- "ProtocolError",
12
- "ValidationError",
13
- ]
@@ -1,22 +0,0 @@
1
- """Connection-related exceptions for XP CLI tool.
2
-
3
- Following the architecture requirement for structured error handling.
4
- """
5
-
6
-
7
- class XPError(Exception):
8
- """Base exception for XP CLI tool."""
9
-
10
- pass
11
-
12
-
13
- class ProtocolError(XPError):
14
- """Console bus protocol errors."""
15
-
16
- pass
17
-
18
-
19
- class ValidationError(XPError):
20
- """Input validation errors."""
21
-
22
- pass