DLMS-SPODES 0.86.21__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 +8 -21
- {dlms_spodes-0.86.21.dist-info → dlms_spodes-0.86.22.dist-info}/METADATA +1 -1
- {dlms_spodes-0.86.21.dist-info → dlms_spodes-0.86.22.dist-info}/RECORD +5 -5
- {dlms_spodes-0.86.21.dist-info → dlms_spodes-0.86.22.dist-info}/WHEEL +0 -0
- {dlms_spodes-0.86.21.dist-info → dlms_spodes-0.86.22.dist-info}/top_level.txt +0 -0
|
@@ -946,7 +946,7 @@ class Collection:
|
|
|
946
946
|
|
|
947
947
|
def get_object(self, value: LNContaining) -> InterfaceClass:
|
|
948
948
|
""" return object from obis<string> or raise exception if it absence """
|
|
949
|
-
return self.
|
|
949
|
+
return self.obis2obj(lnContents2obis(value)).unwrap()
|
|
950
950
|
|
|
951
951
|
@deprecated("use <par2rep>")
|
|
952
952
|
def get_report(self,
|
|
@@ -1114,7 +1114,7 @@ class Collection:
|
|
|
1114
1114
|
"""return only association objects"""
|
|
1115
1115
|
ret = list()
|
|
1116
1116
|
for olt in self.getASSOCIATION(ass_id).object_list:
|
|
1117
|
-
ret.append(self.
|
|
1117
|
+
ret.append(self.par2obj(Parameter(olt.logical_name.contents)).unwrap())
|
|
1118
1118
|
return ret
|
|
1119
1119
|
|
|
1120
1120
|
def sap2objects(self, value: enums.ClientSAP) -> result.List[ic.COSEMInterfaceClasses]:
|
|
@@ -1138,11 +1138,6 @@ class Collection:
|
|
|
1138
1138
|
ret.append(obj)
|
|
1139
1139
|
return ret
|
|
1140
1140
|
|
|
1141
|
-
|
|
1142
|
-
def get_attr(self, value: ut.CosemAttributeDescriptor) -> cdt.CommonDataTypes:
|
|
1143
|
-
"""attribute value from descriptor"""
|
|
1144
|
-
return self.__get_object(value.instance_id.contents).get_attr(int(value.attribute_id))
|
|
1145
|
-
|
|
1146
1141
|
def get_first(self, values: list[str | bytes | cst.LogicalName]) -> InterfaceClass:
|
|
1147
1142
|
""" return first object from it exist in collection from value"""
|
|
1148
1143
|
for val in values:
|
|
@@ -1199,7 +1194,7 @@ class Collection:
|
|
|
1199
1194
|
def copy_obj_attr_values_from(self, other: InterfaceClass) -> bool:
|
|
1200
1195
|
""" copy all attributes value from other and return bool result """
|
|
1201
1196
|
try:
|
|
1202
|
-
obj: InterfaceClass = self.
|
|
1197
|
+
obj: InterfaceClass = self.par2obj(Parameter(other.logical_name.contents)).unwrap()
|
|
1203
1198
|
for i, attr in other.get_index_with_attributes(in_init_order=True):
|
|
1204
1199
|
if i == 1:
|
|
1205
1200
|
continue
|
|
@@ -1217,18 +1212,10 @@ class Collection:
|
|
|
1217
1212
|
else:
|
|
1218
1213
|
return False
|
|
1219
1214
|
|
|
1220
|
-
@deprecated("use <obis2obj>")
|
|
1221
|
-
def __get_object(self, obis: bytes) -> InterfaceClass:
|
|
1222
|
-
if (obj := self.__objs.get(obis)) is None:
|
|
1223
|
-
logical_name = cst.LogicalName(bytearray(obis))
|
|
1224
|
-
raise exc.NoObject(F"{get_name(logical_name)}:{logical_name} is absence")
|
|
1225
|
-
else:
|
|
1226
|
-
return obj
|
|
1227
|
-
|
|
1228
1215
|
def obis2obj(self, obis: o.OBIS) -> result.SimpleOrError[InterfaceClass]:
|
|
1229
1216
|
if obj := self.__objs.get(obis):
|
|
1230
|
-
return result.
|
|
1231
|
-
return result.
|
|
1217
|
+
return result.Simple(obj)
|
|
1218
|
+
return result.Error.from_e(exc.NoObject(obis))
|
|
1232
1219
|
|
|
1233
1220
|
def logicalName2obj(self, ln: cst.LogicalName) -> result.SimpleOrError[InterfaceClass]:
|
|
1234
1221
|
return self.obis2obj(o.OBIS(ln.contents))
|
|
@@ -1317,14 +1304,14 @@ class Collection:
|
|
|
1317
1304
|
|
|
1318
1305
|
def get_script_names(self, ln: cst.LogicalName, selector: cdt.LongUnsigned) -> str:
|
|
1319
1306
|
"""return name from script by selector"""
|
|
1320
|
-
obj = self.
|
|
1307
|
+
obj = self.par2obj(Parameter(ln.contents))
|
|
1321
1308
|
if isinstance(obj, ScriptTable):
|
|
1322
1309
|
for script in obj.scripts:
|
|
1323
1310
|
script: ScriptTable.scripts
|
|
1324
1311
|
if script.script_identifier == selector:
|
|
1325
1312
|
names: list[str] = list()
|
|
1326
1313
|
for action in script.actions:
|
|
1327
|
-
action_obj = self.
|
|
1314
|
+
action_obj = self.par2obj(Parameter(action.logical_name.contents)).unwrap()
|
|
1328
1315
|
if int(action_obj.CLASS_ID) != int(action.class_id):
|
|
1329
1316
|
raise ValueError(F"got {action_obj.CLASS_ID}, expected {action.class_id}")
|
|
1330
1317
|
match int(action.service_id):
|
|
@@ -1409,7 +1396,7 @@ class Collection:
|
|
|
1409
1396
|
def get_name_and_type(self, value: structs.CaptureObjectDefinition) -> tuple[list[str], Type[cdt.CommonDataType]]:
|
|
1410
1397
|
""" return names and type of element from collection"""
|
|
1411
1398
|
names: list[str] = list()
|
|
1412
|
-
obj = self.
|
|
1399
|
+
obj = self.par2obj(Parameter(value.logical_name.contents)).unwrap()
|
|
1413
1400
|
names.append(get_name(obj.logical_name))
|
|
1414
1401
|
attr_index = int(value.attribute_index)
|
|
1415
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
|