DLMS-SPODES-client 0.19.6__py3-none-any.whl → 0.19.7__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.
- DLMS_SPODES_client/task.py +69 -13
- {dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/METADATA +1 -1
- {dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/RECORD +6 -6
- {dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/WHEEL +0 -0
- {dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/entry_points.txt +0 -0
- {dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/top_level.txt +0 -0
DLMS_SPODES_client/task.py
CHANGED
|
@@ -1162,9 +1162,10 @@ class ReadAttributes(SimpleCopy, _List[cdt.CommonDataType]):
|
|
|
1162
1162
|
|
|
1163
1163
|
|
|
1164
1164
|
@dataclass
|
|
1165
|
+
@deprecated("use <Write2>")
|
|
1165
1166
|
class Write(SimpleCopy, OK):
|
|
1166
1167
|
"""write with ParameterData struct"""
|
|
1167
|
-
|
|
1168
|
+
pardata: ParData
|
|
1168
1169
|
msg: str = "write attribute"
|
|
1169
1170
|
|
|
1170
1171
|
async def exchange(self, c: Client) -> result.Ok | result.Error:
|
|
@@ -1188,6 +1189,34 @@ class Write(SimpleCopy, OK):
|
|
|
1188
1189
|
return result.OK
|
|
1189
1190
|
|
|
1190
1191
|
|
|
1192
|
+
@dataclass
|
|
1193
|
+
class Write2(SimpleCopy, OK):
|
|
1194
|
+
"""write with ParameterData struct"""
|
|
1195
|
+
par: Parameter
|
|
1196
|
+
data: cdt.CommonDataType
|
|
1197
|
+
msg: str = "write Data"
|
|
1198
|
+
|
|
1199
|
+
async def exchange(self, c: Client) -> result.Ok | result.Error:
|
|
1200
|
+
if isinstance(res_obj := c.objects.par2obj(self.par), result.Error):
|
|
1201
|
+
return res_obj
|
|
1202
|
+
if self.par.n_elements == 0:
|
|
1203
|
+
enc = self.data.encoding
|
|
1204
|
+
elif isinstance(res_read := await ReadObjAttr(res_obj.value, self.par.i).exchange(c), result.Error):
|
|
1205
|
+
return res_read
|
|
1206
|
+
else:
|
|
1207
|
+
data = a_data
|
|
1208
|
+
for el in self.par.elements():
|
|
1209
|
+
data = data[el]
|
|
1210
|
+
data.set(self.data)
|
|
1211
|
+
enc = data.encoding
|
|
1212
|
+
data = c.get_set_request_normal(
|
|
1213
|
+
obj=res_obj.value,
|
|
1214
|
+
attr_index=self.par.i,
|
|
1215
|
+
value=enc)
|
|
1216
|
+
ret = await c.read_data_block()
|
|
1217
|
+
return result.OK
|
|
1218
|
+
|
|
1219
|
+
|
|
1191
1220
|
@dataclass
|
|
1192
1221
|
class WriteParValue(SimpleCopy, OK):
|
|
1193
1222
|
"""write with ParameterValues struct"""
|
|
@@ -1694,6 +1723,7 @@ class AccessValidate(Base[result.Ok | result.Simple[list[Parameter]]]):
|
|
|
1694
1723
|
|
|
1695
1724
|
|
|
1696
1725
|
@dataclass
|
|
1726
|
+
@deprecated("use <WriteList>")
|
|
1697
1727
|
class WriteParDatas(SimpleCopy, _List[result.Ok]):
|
|
1698
1728
|
"""write by ParData list"""
|
|
1699
1729
|
par_datas: list[ParData]
|
|
@@ -1710,6 +1740,28 @@ class WriteParDatas(SimpleCopy, _List[result.Ok]):
|
|
|
1710
1740
|
return res
|
|
1711
1741
|
|
|
1712
1742
|
|
|
1743
|
+
class WriteList(SimpleCopy, _List[result.Ok]):
|
|
1744
|
+
"""write by list"""
|
|
1745
|
+
par_datas: tuple[Parameter, cdt.CommonDataType]
|
|
1746
|
+
err_ignore: bool
|
|
1747
|
+
|
|
1748
|
+
def __init__(self, *par_datas: tuple[Parameter, cdt.CommonDataType], err_ignore: bool = False, msg = ""):
|
|
1749
|
+
self.par_datas = par_datas
|
|
1750
|
+
self.err_ignore = err_ignore
|
|
1751
|
+
self.msg = msg
|
|
1752
|
+
|
|
1753
|
+
async def exchange(self, c: Client) -> result.List[result.Ok] | result.Error:
|
|
1754
|
+
res = result.List[result.Ok]()
|
|
1755
|
+
for par, data in self.par_datas:
|
|
1756
|
+
if (
|
|
1757
|
+
isinstance(res_one := await Write2(par, data).exchange(c), result.Error)
|
|
1758
|
+
and not self.err_ignore
|
|
1759
|
+
):
|
|
1760
|
+
return res_one
|
|
1761
|
+
res.append(res_one)
|
|
1762
|
+
return res
|
|
1763
|
+
|
|
1764
|
+
|
|
1713
1765
|
@dataclass
|
|
1714
1766
|
class WriteParTranscript(SimpleCopy, OK):
|
|
1715
1767
|
"""write by ParValues[Transcript]"""
|
|
@@ -1733,19 +1785,23 @@ class WriteParTranscript(SimpleCopy, OK):
|
|
|
1733
1785
|
).exchange(c)
|
|
1734
1786
|
|
|
1735
1787
|
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
@dataclass
|
|
1740
|
-
class WriteParTranscripts(SimpleCopy, Sequence[*Ts]):
|
|
1788
|
+
class WriteParTranscripts(SimpleCopy, _List[result.Ok]):
|
|
1741
1789
|
"""write by ParValues[Transcript] list"""
|
|
1742
|
-
par_values:
|
|
1743
|
-
|
|
1790
|
+
par_values: tuple[Parameter, cdt.Transcript]
|
|
1791
|
+
err_ignore: bool
|
|
1744
1792
|
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1793
|
+
def __init__(self, *par_values: tuple[Parameter, cdt.Transcript], err_ignore: bool = False, msg=""):
|
|
1794
|
+
self.par_values = par_values
|
|
1795
|
+
self.err_ignore = err_ignore
|
|
1796
|
+
self.msg = msg
|
|
1797
|
+
|
|
1798
|
+
async def exchange(self, c: Client) -> result.List[T] | result.Error:
|
|
1799
|
+
res = result.List[result.Ok]()
|
|
1800
|
+
for par, value in self.par_values:
|
|
1801
|
+
if (
|
|
1802
|
+
isinstance(res_one := await WriteParTranscript(par, value).exchange(c), result.Error)
|
|
1803
|
+
and not self.err_ignore
|
|
1804
|
+
):
|
|
1749
1805
|
return res_one
|
|
1750
|
-
res
|
|
1806
|
+
res.append(res_one)
|
|
1751
1807
|
return res
|
|
@@ -6,7 +6,7 @@ DLMS_SPODES_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
6
6
|
DLMS_SPODES_client/services.py,sha256=xM_-h322V1bGBcw9cJh7XOSUMTL3_E-GX89-z3YwIYw,3909
|
|
7
7
|
DLMS_SPODES_client/session.py,sha256=1sa4wJny2xwDqL3DXpfYTS7mZcabVdC5fW1H60VB5QA,12681
|
|
8
8
|
DLMS_SPODES_client/settings.py,sha256=6mitGe9UYeEgL61sf933MJ-S5N-ReoxvXqiI3agBGYE,1623
|
|
9
|
-
DLMS_SPODES_client/task.py,sha256=
|
|
9
|
+
DLMS_SPODES_client/task.py,sha256=9A13pYO0n335nv7sDPu83Rg0cQP_-StCLkw2QZZ_m9Y,75566
|
|
10
10
|
DLMS_SPODES_client/gurux_common/enums/TraceLevel.py,sha256=Ne0Rn3c9ACqQjmde_ksbiQxIUv6nXsPQRnhkGwIv3QI,521
|
|
11
11
|
DLMS_SPODES_client/gurux_common/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
DLMS_SPODES_client/gurux_dlms/AesGcmParameter.py,sha256=HJt0uvxtkqKEkvfiqXTMNsiayN15AgPJa9_iMSSFZsQ,1429
|
|
@@ -54,8 +54,8 @@ DLMS_SPODES_client/gurux_dlms/enums/Task.py,sha256=chuOL6-IMxBvABUZtoFcaYaQQB4GZ
|
|
|
54
54
|
DLMS_SPODES_client/gurux_dlms/enums/VdeStateError.py,sha256=qT87LMbIYEs3TYPIp3N-dR2Tcg9KhKyiELwhVl5U-tw,233
|
|
55
55
|
DLMS_SPODES_client/gurux_dlms/enums/__init__.py,sha256=F_sgGwNmmdpbKvP1klJQUNiLXxU2BtZ-LgEI9e6xP8g,1314
|
|
56
56
|
DLMS_SPODES_client/gurux_dlms/internal/_GXCommon.py,sha256=7D9EYcfiZxwbk8sfpHv7s2nYqrbmGf-Tbwv2T-gqmgk,53226
|
|
57
|
-
dlms_spodes_client-0.19.
|
|
58
|
-
dlms_spodes_client-0.19.
|
|
59
|
-
dlms_spodes_client-0.19.
|
|
60
|
-
dlms_spodes_client-0.19.
|
|
61
|
-
dlms_spodes_client-0.19.
|
|
57
|
+
dlms_spodes_client-0.19.7.dist-info/METADATA,sha256=6ulnXqlGP0-tPH_pafbEQfO7Q9FTNEdQE_F8q-j0hSQ,985
|
|
58
|
+
dlms_spodes_client-0.19.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
59
|
+
dlms_spodes_client-0.19.7.dist-info/entry_points.txt,sha256=Z6UTeQjjCf2k1Y3Bjs0s7yr-UYSWb-TvJMuG2K2MApw,70
|
|
60
|
+
dlms_spodes_client-0.19.7.dist-info/top_level.txt,sha256=rh_3Uig5bc6J_lKni01btol7dX_IgIJulNtGjGehmBE,19
|
|
61
|
+
dlms_spodes_client-0.19.7.dist-info/RECORD,,
|
|
File without changes
|
{dlms_spodes_client-0.19.6.dist-info → dlms_spodes_client-0.19.7.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|