DLMS-SPODES 0.86.20__py3-none-any.whl → 0.86.22__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/cosem_interface_classes/collection.py +10 -26
- {dlms_spodes-0.86.20.dist-info → dlms_spodes-0.86.22.dist-info}/METADATA +1 -1
- {dlms_spodes-0.86.20.dist-info → dlms_spodes-0.86.22.dist-info}/RECORD +5 -5
- {dlms_spodes-0.86.20.dist-info → dlms_spodes-0.86.22.dist-info}/WHEEL +0 -0
- {dlms_spodes-0.86.20.dist-info → dlms_spodes-0.86.22.dist-info}/top_level.txt +0 -0
|
@@ -867,9 +867,7 @@ class Collection:
|
|
|
867
867
|
|
|
868
868
|
def par2obj(self, par: Parameter) -> result.SimpleOrError[InterfaceClass]:
|
|
869
869
|
"""return: DLMSObject"""
|
|
870
|
-
|
|
871
|
-
return result.Simple(obj)
|
|
872
|
-
return result.Error.from_e(exc.NoObject(f"with {par=}"), "get object")
|
|
870
|
+
return self.obis2obj(par.obis)
|
|
873
871
|
|
|
874
872
|
def par2data(self, par: Parameter) -> result.Option[cdt.CommonDataType] | result.Error:
|
|
875
873
|
""":return CDT by Parameter, return None if data wasn't setting"""
|
|
@@ -948,7 +946,7 @@ class Collection:
|
|
|
948
946
|
|
|
949
947
|
def get_object(self, value: LNContaining) -> InterfaceClass:
|
|
950
948
|
""" return object from obis<string> or raise exception if it absence """
|
|
951
|
-
return self.
|
|
949
|
+
return self.obis2obj(lnContents2obis(value)).unwrap()
|
|
952
950
|
|
|
953
951
|
@deprecated("use <par2rep>")
|
|
954
952
|
def get_report(self,
|
|
@@ -1116,7 +1114,7 @@ class Collection:
|
|
|
1116
1114
|
"""return only association objects"""
|
|
1117
1115
|
ret = list()
|
|
1118
1116
|
for olt in self.getASSOCIATION(ass_id).object_list:
|
|
1119
|
-
ret.append(self.
|
|
1117
|
+
ret.append(self.par2obj(Parameter(olt.logical_name.contents)).unwrap())
|
|
1120
1118
|
return ret
|
|
1121
1119
|
|
|
1122
1120
|
def sap2objects(self, value: enums.ClientSAP) -> result.List[ic.COSEMInterfaceClasses]:
|
|
@@ -1140,11 +1138,6 @@ class Collection:
|
|
|
1140
1138
|
ret.append(obj)
|
|
1141
1139
|
return ret
|
|
1142
1140
|
|
|
1143
|
-
|
|
1144
|
-
def get_attr(self, value: ut.CosemAttributeDescriptor) -> cdt.CommonDataTypes:
|
|
1145
|
-
"""attribute value from descriptor"""
|
|
1146
|
-
return self.__get_object(value.instance_id.contents).get_attr(int(value.attribute_id))
|
|
1147
|
-
|
|
1148
1141
|
def get_first(self, values: list[str | bytes | cst.LogicalName]) -> InterfaceClass:
|
|
1149
1142
|
""" return first object from it exist in collection from value"""
|
|
1150
1143
|
for val in values:
|
|
@@ -1201,7 +1194,7 @@ class Collection:
|
|
|
1201
1194
|
def copy_obj_attr_values_from(self, other: InterfaceClass) -> bool:
|
|
1202
1195
|
""" copy all attributes value from other and return bool result """
|
|
1203
1196
|
try:
|
|
1204
|
-
obj: InterfaceClass = self.
|
|
1197
|
+
obj: InterfaceClass = self.par2obj(Parameter(other.logical_name.contents)).unwrap()
|
|
1205
1198
|
for i, attr in other.get_index_with_attributes(in_init_order=True):
|
|
1206
1199
|
if i == 1:
|
|
1207
1200
|
continue
|
|
@@ -1219,19 +1212,10 @@ class Collection:
|
|
|
1219
1212
|
else:
|
|
1220
1213
|
return False
|
|
1221
1214
|
|
|
1222
|
-
@deprecated("use <obis2obj>")
|
|
1223
|
-
def __get_object(self, obis: bytes) -> InterfaceClass:
|
|
1224
|
-
if (obj := self.__objs.get(obis)) is None:
|
|
1225
|
-
logical_name = cst.LogicalName(bytearray(obis))
|
|
1226
|
-
raise exc.NoObject(F"{get_name(logical_name)}:{logical_name} is absence")
|
|
1227
|
-
else:
|
|
1228
|
-
return obj
|
|
1229
|
-
|
|
1230
1215
|
def obis2obj(self, obis: o.OBIS) -> result.SimpleOrError[InterfaceClass]:
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
return result.Simple(res.value)
|
|
1216
|
+
if obj := self.__objs.get(obis):
|
|
1217
|
+
return result.Simple(obj)
|
|
1218
|
+
return result.Error.from_e(exc.NoObject(obis))
|
|
1235
1219
|
|
|
1236
1220
|
def logicalName2obj(self, ln: cst.LogicalName) -> result.SimpleOrError[InterfaceClass]:
|
|
1237
1221
|
return self.obis2obj(o.OBIS(ln.contents))
|
|
@@ -1320,14 +1304,14 @@ class Collection:
|
|
|
1320
1304
|
|
|
1321
1305
|
def get_script_names(self, ln: cst.LogicalName, selector: cdt.LongUnsigned) -> str:
|
|
1322
1306
|
"""return name from script by selector"""
|
|
1323
|
-
obj = self.
|
|
1307
|
+
obj = self.par2obj(Parameter(ln.contents))
|
|
1324
1308
|
if isinstance(obj, ScriptTable):
|
|
1325
1309
|
for script in obj.scripts:
|
|
1326
1310
|
script: ScriptTable.scripts
|
|
1327
1311
|
if script.script_identifier == selector:
|
|
1328
1312
|
names: list[str] = list()
|
|
1329
1313
|
for action in script.actions:
|
|
1330
|
-
action_obj = self.
|
|
1314
|
+
action_obj = self.par2obj(Parameter(action.logical_name.contents)).unwrap()
|
|
1331
1315
|
if int(action_obj.CLASS_ID) != int(action.class_id):
|
|
1332
1316
|
raise ValueError(F"got {action_obj.CLASS_ID}, expected {action.class_id}")
|
|
1333
1317
|
match int(action.service_id):
|
|
@@ -1412,7 +1396,7 @@ class Collection:
|
|
|
1412
1396
|
def get_name_and_type(self, value: structs.CaptureObjectDefinition) -> tuple[list[str], Type[cdt.CommonDataType]]:
|
|
1413
1397
|
""" return names and type of element from collection"""
|
|
1414
1398
|
names: list[str] = list()
|
|
1415
|
-
obj = self.
|
|
1399
|
+
obj = self.par2obj(Parameter(value.logical_name.contents)).unwrap()
|
|
1416
1400
|
names.append(get_name(obj.logical_name))
|
|
1417
1401
|
attr_index = int(value.attribute_index)
|
|
1418
1402
|
data_index = int(value.data_index)
|
|
@@ -25,7 +25,7 @@ DLMS_SPODES/cosem_interface_classes/activity_calendar.py,sha256=VWSiKn2LNBA1VLAA
|
|
|
25
25
|
DLMS_SPODES/cosem_interface_classes/arbitrator.py,sha256=S9TguoMG6O5DpMBp6mpcJpw6PHanvh4SEAN3M_v6qts,3240
|
|
26
26
|
DLMS_SPODES/cosem_interface_classes/attr_indexes.py,sha256=aUSnT-dKoBsDbwLhlgtLIHGRl7PZrT-ld2ThCEUjUeA,328
|
|
27
27
|
DLMS_SPODES/cosem_interface_classes/clock.py,sha256=9OJwRGrbFPws_VZPayHv-hzFJegIcjgoJoenIqofd5w,4525
|
|
28
|
-
DLMS_SPODES/cosem_interface_classes/collection.py,sha256=
|
|
28
|
+
DLMS_SPODES/cosem_interface_classes/collection.py,sha256=M_gLt5rIr4OQ_SrgfCEo88m1fxXJAsV3pWhKMQ74d6s,95777
|
|
29
29
|
DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py,sha256=LUtooNc45Fvk2d7oIPRT41zJDQnyo5Y3S5T-90WV7QE,23506
|
|
30
30
|
DLMS_SPODES/cosem_interface_classes/data.py,sha256=YSjA3Y0M5NMcfYzWPEuZw6ojIqr2UghgW_ck8dXySMU,809
|
|
31
31
|
DLMS_SPODES/cosem_interface_classes/disconnect_control.py,sha256=CIx7I4QRpPxAC5iYxpbhCIuv6U2P3s6ELam8eD-kD5w,2926
|
|
@@ -112,7 +112,7 @@ DLMS_SPODES/types/implementations/integers.py,sha256=KAcaTY8ZwhBaJThbLSr39Oh_-9h
|
|
|
112
112
|
DLMS_SPODES/types/implementations/long_unsigneds.py,sha256=SxmFvD2moQ03p-KZSBYK1Rv7bQSaywlHVXBfkTZG1OQ,8761
|
|
113
113
|
DLMS_SPODES/types/implementations/octet_string.py,sha256=Jo_sfWcsfstiP4O6mXfBOOQlksx1c2qJMI-vbAOV-yM,294
|
|
114
114
|
DLMS_SPODES/types/implementations/structs.py,sha256=GMOo6Jy8jA9d6KTLs0D-j5t0oSRvxUIwtBr_4UePwbA,2059
|
|
115
|
-
dlms_spodes-0.86.
|
|
116
|
-
dlms_spodes-0.86.
|
|
117
|
-
dlms_spodes-0.86.
|
|
118
|
-
dlms_spodes-0.86.
|
|
115
|
+
dlms_spodes-0.86.22.dist-info/METADATA,sha256=JpbimJla5saK12q8ybjk8T0xuyut78usRfJOdG3kHEQ,1028
|
|
116
|
+
dlms_spodes-0.86.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
117
|
+
dlms_spodes-0.86.22.dist-info/top_level.txt,sha256=k26SRuRdwBZrSM3NgNZECAUNIDZREbJuLCnPbWtTNak,12
|
|
118
|
+
dlms_spodes-0.86.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|