DLMS-SPODES 0.87.12__py3-none-any.whl → 0.87.15__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.
Files changed (100) hide show
  1. DLMS_SPODES/Values/EN/__init__.py +1 -1
  2. DLMS_SPODES/Values/EN/actors.py +8 -8
  3. DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
  4. DLMS_SPODES/Values/RU/__init__.py +1 -1
  5. DLMS_SPODES/Values/RU/actors.py +8 -8
  6. DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
  7. DLMS_SPODES/__init__.py +6 -6
  8. DLMS_SPODES/configEN.ini +126 -126
  9. DLMS_SPODES/config_parser.py +53 -53
  10. DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
  11. DLMS_SPODES/cosem_interface_classes/__init__.py +1 -1
  12. DLMS_SPODES/cosem_interface_classes/a_parameter.py +20 -20
  13. DLMS_SPODES/cosem_interface_classes/activity_calendar.py +254 -254
  14. DLMS_SPODES/cosem_interface_classes/arbitrator.py +105 -105
  15. DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +34 -34
  16. DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
  17. DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
  18. DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
  19. DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +485 -485
  20. DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +133 -133
  21. DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +36 -36
  22. DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +4 -4
  23. DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +12 -12
  24. DLMS_SPODES/cosem_interface_classes/attr_indexes.py +12 -12
  25. DLMS_SPODES/cosem_interface_classes/clock.py +131 -131
  26. DLMS_SPODES/cosem_interface_classes/collection.py +2122 -2122
  27. DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +583 -583
  28. DLMS_SPODES/cosem_interface_classes/data.py +21 -21
  29. DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +59 -59
  30. DLMS_SPODES/cosem_interface_classes/disconnect_control.py +74 -74
  31. DLMS_SPODES/cosem_interface_classes/extended_register.py +27 -27
  32. DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +43 -43
  33. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +103 -103
  34. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +40 -40
  35. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +9 -9
  36. DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
  37. DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +53 -53
  38. DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +11 -11
  39. DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
  40. DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +126 -126
  41. DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
  42. DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
  43. DLMS_SPODES/cosem_interface_classes/implementations/data.py +487 -487
  44. DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +83 -83
  45. DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +72 -72
  46. DLMS_SPODES/cosem_interface_classes/limiter.py +111 -111
  47. DLMS_SPODES/cosem_interface_classes/ln_pattern.py +333 -333
  48. DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +65 -65
  49. DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +39 -39
  50. DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +67 -67
  51. DLMS_SPODES/cosem_interface_classes/obis.py +23 -23
  52. DLMS_SPODES/cosem_interface_classes/overview.py +197 -197
  53. DLMS_SPODES/cosem_interface_classes/parameter.py +547 -547
  54. DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
  55. DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +122 -122
  56. DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +277 -277
  57. DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +12 -12
  58. DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +10 -10
  59. DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +166 -166
  60. DLMS_SPODES/cosem_interface_classes/register.py +45 -45
  61. DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +80 -80
  62. DLMS_SPODES/cosem_interface_classes/register_monitor.py +46 -46
  63. DLMS_SPODES/cosem_interface_classes/reports.py +70 -70
  64. DLMS_SPODES/cosem_interface_classes/schedule.py +176 -176
  65. DLMS_SPODES/cosem_interface_classes/script_table.py +87 -87
  66. DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +68 -68
  67. DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +158 -158
  68. DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +50 -50
  69. DLMS_SPODES/cosem_interface_classes/special_days_table.py +84 -84
  70. DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +42 -42
  71. DLMS_SPODES/cosem_pdu.py +93 -93
  72. DLMS_SPODES/enums.py +625 -625
  73. DLMS_SPODES/exceptions.py +106 -106
  74. DLMS_SPODES/firmwares.py +99 -99
  75. DLMS_SPODES/hdlc/frame.py +875 -875
  76. DLMS_SPODES/hdlc/sub_layer.py +54 -54
  77. DLMS_SPODES/literals.py +17 -17
  78. DLMS_SPODES/obis/__init__.py +1 -1
  79. DLMS_SPODES/obis/media_id.py +931 -931
  80. DLMS_SPODES/pardata.py +22 -22
  81. DLMS_SPODES/pdu_enums.py +98 -98
  82. DLMS_SPODES/relation_to_OBIS.py +465 -463
  83. DLMS_SPODES/settings.py +551 -551
  84. DLMS_SPODES/types/choices.py +142 -142
  85. DLMS_SPODES/types/common_data_types.py +2401 -2399
  86. DLMS_SPODES/types/cosem_service_types.py +109 -109
  87. DLMS_SPODES/types/implementations/arrays.py +25 -25
  88. DLMS_SPODES/types/implementations/bitstrings.py +97 -97
  89. DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
  90. DLMS_SPODES/types/implementations/enums.py +57 -57
  91. DLMS_SPODES/types/implementations/integers.py +11 -11
  92. DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
  93. DLMS_SPODES/types/implementations/octet_string.py +11 -11
  94. DLMS_SPODES/types/implementations/structs.py +64 -64
  95. DLMS_SPODES/types/useful_types.py +677 -677
  96. {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/METADATA +30 -30
  97. dlms_spodes-0.87.15.dist-info/RECORD +117 -0
  98. {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/WHEEL +1 -1
  99. dlms_spodes-0.87.12.dist-info/RECORD +0 -117
  100. {dlms_spodes-0.87.12.dist-info → dlms_spodes-0.87.15.dist-info}/top_level.txt +0 -0
@@ -1,105 +1,105 @@
1
- from .__class_init__ import *
2
- from ..types.implementations import structs, integers
3
- from .overview import VERSION_0
4
-
5
-
6
- class Actions(cdt.Array):
7
- """ Array of key_data """
8
- TYPE = structs.ActionItem
9
-
10
-
11
- class ActorPermissions(cdt.BitString):
12
- """TODO: """
13
-
14
-
15
- class PermissionsTable(cdt.Array):
16
- TYPE = ActorPermissions
17
- __iter__: ActorPermissions
18
- __get_item__: ActorPermissions
19
-
20
-
21
- class ActorActionWeight(cdt.LongUnsigned):
22
- """TODO: make any thing"""
23
-
24
-
25
- class ActorWeightingList(cdt.Array):
26
- TYPE = ActorActionWeight
27
-
28
-
29
- class WeightingsTable(cdt.Array):
30
- TYPE = ActorWeightingList
31
-
32
-
33
- class MostRecentRequest(cdt.BitString):
34
- """TODO: """
35
-
36
-
37
- class MostRecentRequestTable(cdt.Array):
38
- TYPE = MostRecentRequest
39
-
40
-
41
- class RequestAction(cdt.Structure):
42
- """Defines the actions that are requested by an actorDefines the actions that are requested by an actor"""
43
- request_actor: cdt.Unsigned
44
- request_action_list: cdt.BitString
45
-
46
-
47
- class Arbitrator(ic.COSEMInterfaceClasses):
48
- """DLMS UA 1000-1 Ed. 14 4.5.12 Arbitrator"""
49
- CLASS_ID = ClassID.ARBITRATOR
50
- VERSION = VERSION_0
51
- A_ELEMENTS = (ic.ICAElement("actions", Actions),
52
- ic.ICAElement("permission_table", PermissionsTable),
53
- ic.ICAElement("weightings_table", WeightingsTable),
54
- ic.ICAElement("most_recent_requests_table", MostRecentRequestTable, classifier=ic.Classifier.DYNAMIC),
55
- ic.ICAElement("last_outcome", cdt.Unsigned, min=0, default=0, classifier=ic.Classifier.DYNAMIC)) # TODO: max = n what it?
56
- M_ELEMENTS = (ic.ICMElement("request_action", RequestAction),
57
- ic.ICMElement("reset", integers.Only0))
58
- actors: tuple[str] = tuple()
59
- """name actors container"""
60
-
61
- def characteristics_init(self):
62
- self.set_attr(2, None)
63
- self.actions.register_cb_post_set(self.__check_permission_table)
64
- self.set_attr(3, None)
65
- self.set_attr(4, None)
66
- self.set_attr(5, None)
67
-
68
- @property
69
- def actions(self) -> Actions:
70
- return self.get_attr(2)
71
-
72
- @property
73
- def permissions_table(self) -> PermissionsTable:
74
- return self.get_attr(3)
75
-
76
- @property
77
- def weightings_table(self) -> WeightingsTable:
78
- return self.get_attr(4)
79
-
80
- @property
81
- def most_recent_request_table(self) -> MostRecentRequestTable:
82
- return self.get_attr(5)
83
-
84
- @property
85
- def last_outcome(self) -> cdt.Unsigned:
86
- return self.get_attr(6)
87
-
88
- @property
89
- def request_action(self) -> RequestAction:
90
- return self .get_meth(1)
91
-
92
- @property
93
- def reset(self) -> integers.Only0:
94
- return self .get_meth(2)
95
-
96
- def __check_permission_table(self):
97
- """set length actor_permission be same as action array size if it not valid"""
98
- if len(self.permissions_table) > 0:
99
- for actor in self.permissions_table:
100
- if len(actor) != len(self.actions):
101
- actor.set(ActorPermissions('0'*len(self.actions)))
102
- else:
103
- """lenght is correct, change is not required """
104
- else:
105
- """not was loaded"""
1
+ from .__class_init__ import *
2
+ from ..types.implementations import structs, integers
3
+ from .overview import VERSION_0
4
+
5
+
6
+ class Actions(cdt.Array):
7
+ """ Array of key_data """
8
+ TYPE = structs.ActionItem
9
+
10
+
11
+ class ActorPermissions(cdt.BitString):
12
+ """TODO: """
13
+
14
+
15
+ class PermissionsTable(cdt.Array):
16
+ TYPE = ActorPermissions
17
+ __iter__: ActorPermissions
18
+ __get_item__: ActorPermissions
19
+
20
+
21
+ class ActorActionWeight(cdt.LongUnsigned):
22
+ """TODO: make any thing"""
23
+
24
+
25
+ class ActorWeightingList(cdt.Array):
26
+ TYPE = ActorActionWeight
27
+
28
+
29
+ class WeightingsTable(cdt.Array):
30
+ TYPE = ActorWeightingList
31
+
32
+
33
+ class MostRecentRequest(cdt.BitString):
34
+ """TODO: """
35
+
36
+
37
+ class MostRecentRequestTable(cdt.Array):
38
+ TYPE = MostRecentRequest
39
+
40
+
41
+ class RequestAction(cdt.Structure):
42
+ """Defines the actions that are requested by an actorDefines the actions that are requested by an actor"""
43
+ request_actor: cdt.Unsigned
44
+ request_action_list: cdt.BitString
45
+
46
+
47
+ class Arbitrator(ic.COSEMInterfaceClasses):
48
+ """DLMS UA 1000-1 Ed. 14 4.5.12 Arbitrator"""
49
+ CLASS_ID = ClassID.ARBITRATOR
50
+ VERSION = VERSION_0
51
+ A_ELEMENTS = (ic.ICAElement("actions", Actions),
52
+ ic.ICAElement("permission_table", PermissionsTable),
53
+ ic.ICAElement("weightings_table", WeightingsTable),
54
+ ic.ICAElement("most_recent_requests_table", MostRecentRequestTable, classifier=ic.Classifier.DYNAMIC),
55
+ ic.ICAElement("last_outcome", cdt.Unsigned, min=0, default=0, classifier=ic.Classifier.DYNAMIC)) # TODO: max = n what it?
56
+ M_ELEMENTS = (ic.ICMElement("request_action", RequestAction),
57
+ ic.ICMElement("reset", integers.Only0))
58
+ actors: tuple[str] = tuple()
59
+ """name actors container"""
60
+
61
+ def characteristics_init(self):
62
+ self.set_attr(2, None)
63
+ self.actions.register_cb_post_set(self.__check_permission_table)
64
+ self.set_attr(3, None)
65
+ self.set_attr(4, None)
66
+ self.set_attr(5, None)
67
+
68
+ @property
69
+ def actions(self) -> Actions:
70
+ return self.get_attr(2)
71
+
72
+ @property
73
+ def permissions_table(self) -> PermissionsTable:
74
+ return self.get_attr(3)
75
+
76
+ @property
77
+ def weightings_table(self) -> WeightingsTable:
78
+ return self.get_attr(4)
79
+
80
+ @property
81
+ def most_recent_request_table(self) -> MostRecentRequestTable:
82
+ return self.get_attr(5)
83
+
84
+ @property
85
+ def last_outcome(self) -> cdt.Unsigned:
86
+ return self.get_attr(6)
87
+
88
+ @property
89
+ def request_action(self) -> RequestAction:
90
+ return self .get_meth(1)
91
+
92
+ @property
93
+ def reset(self) -> integers.Only0:
94
+ return self .get_meth(2)
95
+
96
+ def __check_permission_table(self):
97
+ """set length actor_permission be same as action array size if it not valid"""
98
+ if len(self.permissions_table) > 0:
99
+ for actor in self.permissions_table:
100
+ if len(actor) != len(self.actions):
101
+ actor.set(ActorPermissions('0'*len(self.actions)))
102
+ else:
103
+ """lenght is correct, change is not required """
104
+ else:
105
+ """not was loaded"""
@@ -1,34 +1,34 @@
1
- from abc import ABC, abstractmethod
2
- from ...types import cdt
3
-
4
-
5
- class AccessMode(cdt.Enum, ABC):
6
- """ TODO: """
7
- @abstractmethod
8
- def is_writable(self) -> bool:
9
- ...
10
-
11
- @abstractmethod
12
- def is_readable(self) -> bool:
13
- ...
14
-
15
-
16
- class AttributeAccessItem(cdt.Structure, ABC):
17
- """ Implemented attribute and it access . Use in Association LN """
18
- attribute_id: cdt.Integer
19
- access_mode: AccessMode
20
- access_selectors: cdt.NullData # override in version
21
-
22
- @abstractmethod
23
- def abstract_marker(self):
24
- """dummy abstract marker"""
25
-
26
-
27
- class AttributeAccessDescriptor(cdt.Array, ABC):
28
- """ Array of attribute_access_item """
29
- TYPE = AttributeAccessItem
30
- """override this"""
31
-
32
- @abstractmethod
33
- def set_read_access(self, attribute_id: cdt.Integer):
34
- """by attribute_id"""
1
+ from abc import ABC, abstractmethod
2
+ from ...types import cdt
3
+
4
+
5
+ class AccessMode(cdt.Enum, ABC):
6
+ """ TODO: """
7
+ @abstractmethod
8
+ def is_writable(self) -> bool:
9
+ ...
10
+
11
+ @abstractmethod
12
+ def is_readable(self) -> bool:
13
+ ...
14
+
15
+
16
+ class AttributeAccessItem(cdt.Structure, ABC):
17
+ """ Implemented attribute and it access . Use in Association LN """
18
+ attribute_id: cdt.Integer
19
+ access_mode: AccessMode
20
+ access_selectors: cdt.NullData # override in version
21
+
22
+ @abstractmethod
23
+ def abstract_marker(self):
24
+ """dummy abstract marker"""
25
+
26
+
27
+ class AttributeAccessDescriptor(cdt.Array, ABC):
28
+ """ Array of attribute_access_item """
29
+ TYPE = AttributeAccessItem
30
+ """override this"""
31
+
32
+ @abstractmethod
33
+ def set_read_access(self, attribute_id: cdt.Integer):
34
+ """by attribute_id"""
@@ -1,25 +1,25 @@
1
- from functools import lru_cache
2
- from ...types import common_data_types as cdt
3
- from . import mechanism_id
4
-
5
-
6
- class AuthenticationMechanismName(cdt.Structure):
7
- """ Contains the name of the authentication mechanism for the association (see IEC 62056-53). The authentication mechanism name is specified as an
8
- OBJECT IDENTIFIER in 7.3.7.2 of IEC 62056-53. The authentication_mechanism_name attribute includes the arc labels of the OBJECT IDENTIFIER. """
9
- DEFAULT = (2, 16, 756, 5, 8, 2, 0)
10
- joint_iso_ctt_element: cdt.Unsigned
11
- country_element: cdt.Unsigned
12
- country_name_element: cdt.LongUnsigned
13
- identified_organization_element: cdt.Unsigned
14
- DLMS_UA_element: cdt.Unsigned
15
- authentication_mechanism_name_element: cdt.Unsigned
16
- mechanism_id_element: mechanism_id.MechanismIdElement
17
-
18
- @classmethod
19
- @lru_cache(maxsize=32)
20
- def get_AARQ_mechanism_name(cls, cryptographic: int, algorithm_id: int) -> bytes:
21
- """according to DLMS UA 1000-2 Ed. 10 9.4.2.2.4 Cryptographic algorithm ID-s"""
22
- default = list(AuthenticationMechanismName.DEFAULT)
23
- default[5] = cryptographic
24
- default[6] = algorithm_id
25
- return AuthenticationMechanismName(tuple(default)).get_a_xdr()
1
+ from functools import lru_cache
2
+ from ...types import common_data_types as cdt
3
+ from . import mechanism_id
4
+
5
+
6
+ class AuthenticationMechanismName(cdt.Structure):
7
+ """ Contains the name of the authentication mechanism for the association (see IEC 62056-53). The authentication mechanism name is specified as an
8
+ OBJECT IDENTIFIER in 7.3.7.2 of IEC 62056-53. The authentication_mechanism_name attribute includes the arc labels of the OBJECT IDENTIFIER. """
9
+ DEFAULT = (2, 16, 756, 5, 8, 2, 0)
10
+ joint_iso_ctt_element: cdt.Unsigned
11
+ country_element: cdt.Unsigned
12
+ country_name_element: cdt.LongUnsigned
13
+ identified_organization_element: cdt.Unsigned
14
+ DLMS_UA_element: cdt.Unsigned
15
+ authentication_mechanism_name_element: cdt.Unsigned
16
+ mechanism_id_element: mechanism_id.MechanismIdElement
17
+
18
+ @classmethod
19
+ @lru_cache(maxsize=32)
20
+ def get_AARQ_mechanism_name(cls, cryptographic: int, algorithm_id: int) -> bytes:
21
+ """according to DLMS UA 1000-2 Ed. 10 9.4.2.2.4 Cryptographic algorithm ID-s"""
22
+ default = list(AuthenticationMechanismName.DEFAULT)
23
+ default[5] = cryptographic
24
+ default[6] = algorithm_id
25
+ return AuthenticationMechanismName(tuple(default)).get_a_xdr()
@@ -1,25 +1,25 @@
1
- from ...types import cdt
2
-
3
-
4
- class MechanismIdElement(cdt.Enum, elements=tuple(range(8))):
5
- TAG = b'\x11'
6
-
7
-
8
- class ConstantMixin:
9
- """override raise for set"""
10
- def set(self, *args, **kwargs):
11
- raise AttributeError(F"not support <set> for {self.__class__.__name__} constant")
12
-
13
-
14
- class MechanismIdElementConst(ConstantMixin, MechanismIdElement):
15
- """"""
16
-
17
-
18
- NONE = MechanismIdElementConst(0)
19
- LOW = MechanismIdElementConst(1)
20
- HIGH = MechanismIdElementConst(2)
21
- HIGH_MD5 = MechanismIdElementConst(3)
22
- HIGH_SHA1 = MechanismIdElementConst(4)
23
- HIGH_GMAC = MechanismIdElementConst(5)
24
- HIGH_SHA256 = MechanismIdElementConst(6)
25
- HIGH_ECDSA = MechanismIdElementConst(7)
1
+ from ...types import cdt
2
+
3
+
4
+ class MechanismIdElement(cdt.Enum, elements=tuple(range(8))):
5
+ TAG = b'\x11'
6
+
7
+
8
+ class ConstantMixin:
9
+ """override raise for set"""
10
+ def set(self, *args, **kwargs):
11
+ raise AttributeError(F"not support <set> for {self.__class__.__name__} constant")
12
+
13
+
14
+ class MechanismIdElementConst(ConstantMixin, MechanismIdElement):
15
+ """"""
16
+
17
+
18
+ NONE = MechanismIdElementConst(0)
19
+ LOW = MechanismIdElementConst(1)
20
+ HIGH = MechanismIdElementConst(2)
21
+ HIGH_MD5 = MechanismIdElementConst(3)
22
+ HIGH_SHA1 = MechanismIdElementConst(4)
23
+ HIGH_GMAC = MechanismIdElementConst(5)
24
+ HIGH_SHA256 = MechanismIdElementConst(6)
25
+ HIGH_ECDSA = MechanismIdElementConst(7)
@@ -1,5 +1,5 @@
1
- from ...types import cdt
2
-
3
-
4
- class ReplyToHLSAuthentication(cdt.OctetString):
5
- """""" # todo: make validate by contents
1
+ from ...types import cdt
2
+
3
+
4
+ class ReplyToHLSAuthentication(cdt.OctetString):
5
+ """""" # todo: make validate by contents