DLMS-SPODES 0.87.17__py3-none-any.whl → 0.88.1__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/Values/EN/__init__.py +1 -1
- DLMS_SPODES/Values/EN/actors.py +8 -8
- DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
- DLMS_SPODES/Values/RU/__init__.py +1 -1
- DLMS_SPODES/Values/RU/actors.py +8 -8
- DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
- DLMS_SPODES/__init__.py +6 -6
- DLMS_SPODES/configEN.ini +126 -126
- DLMS_SPODES/config_parser.py +53 -53
- DLMS_SPODES/cosem_interface_classes/Overview/__init__.py +0 -0
- DLMS_SPODES/cosem_interface_classes/Overview/class_id.py +107 -0
- DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +3 -2
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +210 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +78 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +50 -34
- DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
- DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +440 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +126 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +30 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +3 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +14 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +81 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2106 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +525 -583
- DLMS_SPODES/cosem_interface_classes/data.py +12 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +32 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +56 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +18 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +33 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +78 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +42 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +6 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +27 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +9 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +54 -126
- DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
- DLMS_SPODES/cosem_interface_classes/implementations/data.py +491 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +85 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +42 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +77 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +334 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +51 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +27 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +48 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +28 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +198 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +548 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +90 -133
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +268 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +13 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +9 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +124 -166
- DLMS_SPODES/cosem_interface_classes/register.py +18 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +45 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +33 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +72 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +88 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +54 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +45 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +122 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +34 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +54 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +20 -42
- DLMS_SPODES/cosem_pdu.py +93 -93
- DLMS_SPODES/enums.py +625 -625
- DLMS_SPODES/exceptions.py +106 -106
- DLMS_SPODES/firmwares.py +99 -99
- DLMS_SPODES/hdlc/frame.py +875 -875
- DLMS_SPODES/hdlc/sub_layer.py +54 -54
- DLMS_SPODES/literals.py +17 -17
- DLMS_SPODES/obis/__init__.py +1 -1
- DLMS_SPODES/obis/media_id.py +931 -931
- DLMS_SPODES/pardata.py +22 -22
- DLMS_SPODES/pdu_enums.py +98 -98
- DLMS_SPODES/relation_to_OBIS.py +463 -465
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +140 -142
- DLMS_SPODES/types/common_data_types.py +2379 -2401
- DLMS_SPODES/types/cosem_service_types.py +109 -109
- DLMS_SPODES/types/implementations/arrays.py +25 -25
- DLMS_SPODES/types/implementations/bitstrings.py +97 -97
- DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
- DLMS_SPODES/types/implementations/enums.py +57 -57
- DLMS_SPODES/types/implementations/integers.py +12 -11
- DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
- DLMS_SPODES/types/implementations/octet_string.py +11 -11
- DLMS_SPODES/types/implementations/structs.py +64 -64
- DLMS_SPODES/types/type_alias.py +74 -0
- DLMS_SPODES/types/useful_types.py +627 -677
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/METADATA +30 -30
- dlms_spodes-0.88.1.dist-info/RECORD +118 -0
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/WHEEL +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +0 -20
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +0 -12
- dlms_spodes-0.87.17.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
|
@@ -1,65 +1,51 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def characteristics_init(self):
|
|
53
|
-
"""nothing do it"""
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
def comm_speed(self) -> CommSpeed:
|
|
57
|
-
return self.get_attr(2)
|
|
58
|
-
|
|
59
|
-
@property
|
|
60
|
-
def initialization_string(self) -> InitializationString:
|
|
61
|
-
return self.get_attr(3)
|
|
62
|
-
|
|
63
|
-
@property
|
|
64
|
-
def modem_profile(self) -> ModemProfile:
|
|
65
|
-
return self.get_attr(4)
|
|
1
|
+
from ...types.implementations.enums import CommSpeed
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from ...types import cdt
|
|
4
|
+
from ..cosem_interface_class import ICAElement, ICAuto
|
|
5
|
+
from ..Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InitializationStringElement(cdt.Structure):
|
|
9
|
+
""" initialization_string_element"""
|
|
10
|
+
request: cdt.OctetString
|
|
11
|
+
response: cdt.OctetString
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class InitializationString(cdt.Array):
|
|
15
|
+
"""initialization_string attribute"""
|
|
16
|
+
TYPE = InitializationStringElement
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ModemProfileElement(cdt.OctetString):
|
|
20
|
+
"""modem_profile_element"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, value: bytes = b'OK'.hex()):
|
|
23
|
+
super(ModemProfileElement, self).__init__(value)
|
|
24
|
+
if bytes(self) not in self.get_validate_values(): # todo: make ReportMixin
|
|
25
|
+
raise ValueError(F'Got modem profile element {bytes(self)}, expected {b", ".join(self.get_validate_values())}')
|
|
26
|
+
else:
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
@staticmethod
|
|
30
|
+
def get_validate_values() -> tuple[bytes, ...]:
|
|
31
|
+
return b'OK', b'CONNECT', b'RING', b'NO CARRIER', b'ERROR', b'CONNECT 1 200', b'NO DIAL TONE', b'BUSY', b'NO ANSWER', b'CONNECT 600', b'CONNECT 2 400', b'CONNECT 4 800', \
|
|
32
|
+
b'CONNECT 9 600', b'CONNECT 14 400', b'CONNECT 28 800', b'CONNECT 36 600', b'CONNECT 56 000'
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ModemProfile(cdt.Array):
|
|
36
|
+
"""modem_profile attribute"""
|
|
37
|
+
TYPE = ModemProfileElement
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class PSTNModemConfiguration(ICAuto):
|
|
41
|
+
"""5.7.4 PSTN modem configuration"""
|
|
42
|
+
CLASS_ID = class_id.MODEM_CONFIGURATION
|
|
43
|
+
VERSION = 0
|
|
44
|
+
A_ELEMENTS = (
|
|
45
|
+
ICAElement(2, "comm_speed", CommSpeed, 0, 9, 5),
|
|
46
|
+
ICAElement(3, "initialization_string", InitializationString),
|
|
47
|
+
ICAElement(4, "modem_profile", ModemProfile)
|
|
48
|
+
)
|
|
49
|
+
comm_speed: Optional[CommSpeed]
|
|
50
|
+
initialization_string: Optional[InitializationString]
|
|
51
|
+
modem_profile: Optional[ModemProfile]
|
|
@@ -1,39 +1,27 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def characteristics_init(self):
|
|
30
|
-
"""nothing do it"""
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def initialization_string(self) -> InitializationString:
|
|
34
|
-
return self.get_attr(3)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if __name__ == '__main__':
|
|
38
|
-
a = ModemConfigurationVer1('0.0.2.0.0.255')
|
|
39
|
-
print(a)
|
|
1
|
+
from . import ver0
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from ...types import cdt
|
|
4
|
+
from ..cosem_interface_class import ICAElement
|
|
5
|
+
from ..Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InitializationStringElement(cdt.Structure):
|
|
9
|
+
"""initialization_string_element"""
|
|
10
|
+
request: cdt.OctetString
|
|
11
|
+
response: cdt.OctetString
|
|
12
|
+
delay_after_response: cdt.LongUnsigned
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class InitializationString(cdt.Array):
|
|
16
|
+
"""initialization_string attribute"""
|
|
17
|
+
TYPE = InitializationStringElement
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ModemConfigurationVer1(ver0.PSTNModemConfiguration):
|
|
21
|
+
"""4.7.4 Modem configuration"""
|
|
22
|
+
ClassID = class_id.MODEM_CONFIGURATION
|
|
23
|
+
VERSION = 1
|
|
24
|
+
A_ELEMENTS = (ver0.PSTNModemConfiguration.getAElement(2).unwrap(),
|
|
25
|
+
ICAElement(3, "initialization_string", InitializationString),
|
|
26
|
+
ver0.PSTNModemConfiguration.getAElement(4).unwrap())
|
|
27
|
+
initialization_string: Optional[InitializationString]
|
|
@@ -1,67 +1,48 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def server_address(self) -> ServerAddress:
|
|
51
|
-
return self.get_attr(3)
|
|
52
|
-
|
|
53
|
-
@property
|
|
54
|
-
def server_port(self) -> cdt.LongUnsigned:
|
|
55
|
-
return self.get_attr(4)
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def authentication_method(self) -> AuthenticationMethod:
|
|
59
|
-
return self.get_attr(5)
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def authentication_keys(self) -> AuthenticationKeys:
|
|
63
|
-
return self.get_attr(6)
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def client_key(self) -> cdt.OctetString:
|
|
67
|
-
return self.get_attr(7)
|
|
1
|
+
from ...types.implementations import integers
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from ...types import cdt
|
|
4
|
+
from ..cosem_interface_class import ICAElement, ICAuto, ICMElement
|
|
5
|
+
from ..Overview import class_id
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServerAddress(cdt.OctetString):
|
|
9
|
+
"""server_address attribute"""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AuthenticationMethod(cdt.Enum, elements=(0, 1, 2)):
|
|
13
|
+
"""authentication_method attribute"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AuthenticationKey(cdt.Structure):
|
|
17
|
+
"""authentication_key"""
|
|
18
|
+
key_id: cdt.DoubleLongUnsigned
|
|
19
|
+
key: cdt.OctetString
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AuthenticationKeys(cdt.Array):
|
|
23
|
+
"""authentication_keys"""
|
|
24
|
+
TYPE = AuthenticationKey
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class NTPSetup(ICAuto):
|
|
28
|
+
"""4.9.7 NTP setup"""
|
|
29
|
+
CLASS_ID = class_id.NTP_SETUP
|
|
30
|
+
VERSION = 0
|
|
31
|
+
A_ELEMENTS = (
|
|
32
|
+
ICAElement(2, "activated", cdt.Boolean, default=False),
|
|
33
|
+
ICAElement(3, "server_address", ServerAddress),
|
|
34
|
+
ICAElement(4, "server_port", cdt.LongUnsigned, default=123),
|
|
35
|
+
ICAElement(5, "authentication_method", AuthenticationMethod),
|
|
36
|
+
ICAElement(6, "authentication_keys", AuthenticationKeys),
|
|
37
|
+
ICAElement(7, "client_key", cdt.OctetString))
|
|
38
|
+
M_ELEMENTS = (
|
|
39
|
+
ICMElement(1, "synchronize", integers.Only0),
|
|
40
|
+
ICMElement(2, "add_authentication_key", AuthenticationKey),
|
|
41
|
+
ICMElement(3, "delete_authentication_key", cdt.DoubleLongUnsigned),
|
|
42
|
+
)
|
|
43
|
+
activated: Optional[cdt.Boolean]
|
|
44
|
+
server_address: Optional[ServerAddress]
|
|
45
|
+
server_port: Optional[cdt.LongUnsigned]
|
|
46
|
+
authentication_method: Optional[AuthenticationMethod]
|
|
47
|
+
authentication_keys: Optional[AuthenticationKeys]
|
|
48
|
+
client_key: Optional[cdt.OctetString]
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
from typing_extensions import deprecated
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@deprecated("use <bytes>")
|
|
5
|
+
class OBIS(bytes):
|
|
6
|
+
"""bytes[6]"""
|
|
7
|
+
__slots__ = ()
|
|
8
|
+
|
|
9
|
+
def validate(self):
|
|
10
|
+
if (length := len(self)) != 6:
|
|
11
|
+
return ValueError(f"got {length=}, expected 6")
|
|
12
|
+
|
|
13
|
+
def __str__(self):
|
|
14
|
+
return F"{".".join(map(str, self[:6]))}"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AssociationLN(OBIS):
|
|
18
|
+
def __new__(cls, e: int):
|
|
19
|
+
return super().__new__(cls, (0, 0, 40, 0, e, 255))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
CURRENT_ASSOCIATION = OBIS((0, 0, 40, 0, 0, 255))
|
|
23
|
+
PUBLIC_ASSOCIATION = OBIS((0, 0, 40, 0, 1, 255))
|
|
24
|
+
LDN = OBIS((0, 0, 42, 0, 0, 255))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# SPODES_3
|
|
28
|
+
SPODES3_DISPLAY_MODE = OBIS((0, 0, 96, 4, 1, 255))
|