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.
Files changed (103) 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/Overview/__init__.py +0 -0
  11. DLMS_SPODES/cosem_interface_classes/Overview/class_id.py +107 -0
  12. DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
  13. DLMS_SPODES/cosem_interface_classes/__init__.py +3 -2
  14. DLMS_SPODES/cosem_interface_classes/activity_calendar.py +210 -254
  15. DLMS_SPODES/cosem_interface_classes/arbitrator.py +78 -105
  16. DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +50 -34
  17. DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
  18. DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
  19. DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
  20. DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +440 -485
  21. DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +126 -133
  22. DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +30 -36
  23. DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +3 -4
  24. DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +14 -12
  25. DLMS_SPODES/cosem_interface_classes/clock.py +81 -131
  26. DLMS_SPODES/cosem_interface_classes/collection.py +2106 -2122
  27. DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +525 -583
  28. DLMS_SPODES/cosem_interface_classes/data.py +12 -21
  29. DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +32 -59
  30. DLMS_SPODES/cosem_interface_classes/disconnect_control.py +56 -74
  31. DLMS_SPODES/cosem_interface_classes/extended_register.py +18 -27
  32. DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +33 -43
  33. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +78 -103
  34. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +42 -40
  35. DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +6 -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 +27 -53
  38. DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +9 -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 +54 -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 +491 -487
  44. DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +85 -83
  45. DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +42 -72
  46. DLMS_SPODES/cosem_interface_classes/limiter.py +77 -111
  47. DLMS_SPODES/cosem_interface_classes/ln_pattern.py +334 -333
  48. DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +51 -65
  49. DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +27 -39
  50. DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +48 -67
  51. DLMS_SPODES/cosem_interface_classes/obis.py +28 -23
  52. DLMS_SPODES/cosem_interface_classes/overview.py +198 -197
  53. DLMS_SPODES/cosem_interface_classes/parameter.py +548 -547
  54. DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
  55. DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +90 -133
  56. DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +268 -277
  57. DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +13 -12
  58. DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +9 -10
  59. DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +124 -166
  60. DLMS_SPODES/cosem_interface_classes/register.py +18 -45
  61. DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +45 -80
  62. DLMS_SPODES/cosem_interface_classes/register_monitor.py +33 -46
  63. DLMS_SPODES/cosem_interface_classes/reports.py +72 -70
  64. DLMS_SPODES/cosem_interface_classes/schedule.py +88 -176
  65. DLMS_SPODES/cosem_interface_classes/script_table.py +54 -87
  66. DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +45 -68
  67. DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +122 -158
  68. DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +34 -50
  69. DLMS_SPODES/cosem_interface_classes/special_days_table.py +54 -84
  70. DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +20 -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 +463 -465
  83. DLMS_SPODES/settings.py +551 -551
  84. DLMS_SPODES/types/choices.py +140 -142
  85. DLMS_SPODES/types/common_data_types.py +2379 -2401
  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 +12 -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/type_alias.py +74 -0
  96. DLMS_SPODES/types/useful_types.py +627 -677
  97. {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/METADATA +30 -30
  98. dlms_spodes-0.88.1.dist-info/RECORD +118 -0
  99. {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/WHEEL +1 -1
  100. DLMS_SPODES/cosem_interface_classes/a_parameter.py +0 -20
  101. DLMS_SPODES/cosem_interface_classes/attr_indexes.py +0 -12
  102. dlms_spodes-0.87.17.dist-info/RECORD +0 -117
  103. {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
DLMS_SPODES/settings.py CHANGED
@@ -1,551 +1,551 @@
1
- import os
2
- from pydantic import BaseModel, Field, field_serializer
3
- import tomllib
4
- from enum import Enum
5
- from pathlib import Path
6
-
7
-
8
- class _ReportStruct(BaseModel):
9
- """
10
- Patterns. Use for function get_obj_report. Only for struct. Generate custom struct report instead standart. Where %nxx: n - name of struct element,
11
- xx - index of struct element; %vxx: v - value of struct element, xx - index of struct element
12
- """
13
- DayProfileAction: str = "%n00: %v00 - Тариф: %v02"
14
-
15
-
16
- class _Report(BaseModel):
17
- empty: str = "--"
18
- empty_unit: str = "??"
19
- scaler_format: str = "{:.3f}"
20
- struct: _ReportStruct = Field(default_factory=_ReportStruct)
21
-
22
-
23
- class _Collection(BaseModel):
24
- path: str = "./Types/"
25
-
26
-
27
- class _FirmwaresKey(BaseModel):
28
- codec: str = "ascii"
29
- value: str = "00000000password"
30
-
31
-
32
- class _Firmware(BaseModel):
33
- key: _FirmwaresKey = Field(default_factory=_FirmwaresKey)
34
- man: str = Field("KPZ")
35
- path: Path = Field(Path("./Firmwares/firmwares.dat"))
36
-
37
- @field_serializer("path")
38
- def serialize1_path(self, path: Path) -> str:
39
- return str(path)
40
-
41
-
42
- class _AmNames(BaseModel):
43
- """all attributes and methods names of classes"""
44
- APN: str = "APN"
45
- CRC_NOK_frames_counter: str = "CRC NOK frames counter"
46
- CRC_OK_frames_counter: str = "CRC OK frames counter"
47
- DL_reference: str = "DL reference"
48
- FCS_NOK_frames_counter: str = "FCS NOK frames counter"
49
- FCS_OK_frames_counter: str = "FCS OK frames counter"
50
- IPCP_options: str = "IPCP options"
51
- IP_address: str = "IP address"
52
- IP_options: str = "IP options"
53
- IP_reference: str = "IP reference"
54
- LCP_options: str = "LCP options"
55
- LLS_secret: str = "LLS secret"
56
- LTE_network_parameters: str = "LTE network parameters"
57
- LTE_quality_of_service: str = "LTE quality of service"
58
- M_Bus_Data_Header_Type: str = "M-Bus Data Header Type"
59
- MAC_address: str = "MAC address"
60
- MMS: str = "MMS"
61
- M_Bus_port_communication_state: str = "M Bus port communication state"
62
- M_Bus_profile_selection: str = "M Bus profile selection"
63
- PHY_reference: str = "PHY reference"
64
- PIN_code: str = "PIN code"
65
- PPP_authentication: str = "PPP authentication"
66
- SAP_assignment_list: str = "SAP assignment list"
67
- TCP_UDP_port: str = "TCP UDP port"
68
- access_number: str = "access number"
69
- access_rights_list: str = "access rights list"
70
- account_activation_time: str = "account activation time"
71
- account_closure_time: str = "account closure time"
72
- account_mode_and_status: str = "account mode and status"
73
- acknowledgement_time_t1: str = "acknowledgement time t1"
74
- acknowledgement_timer: str = "acknowledgement timer"
75
- actions: str = "actions"
76
- activate_account: str = "activate account"
77
- activate_passive_calendar: str = "activate passive calendar"
78
- activate_passive_calendar_time: str = "activate passive calendar time"
79
- activate_passive_unit_charge: str = "activate passive unit charge"
80
- activated: str = "activated"
81
- activation_status: str = "activation status"
82
- active_initiator: str = "active initiator"
83
- active_mask: str = "active mask"
84
- add_IPv6_address: str = "add IPv6 address"
85
- add_authentication_key: str = "add authentication key"
86
- add_function: str = "add function"
87
- add_mask: str = "add mask"
88
- add_mc_IP_address: str = "add mc IP address"
89
- add_object: str = "add object"
90
- add_parameter: str = "add parameter"
91
- add_register: str = "add register"
92
- add_user: str = "add user"
93
- addr_state: str = "addr state"
94
- address_config_mode: str = "address config mode"
95
- address_mask: str = "address mask"
96
- adjacent_cell: str = "adjacent cell"
97
- adjust_to_measuring_period: str = "adjust to measuring period"
98
- adjust_to_minute: str = "adjust to minute"
99
- adjust_to_preset_time: str = "adjust to preset time"
100
- adjust_to_quarter: str = "adjust to quarter"
101
- adjustment_method: str = "adjustment method"
102
- aggregated_debt: str = "aggregated debt"
103
- alarm: str = "alarm"
104
- allowed_failed_attempts: str = "allowed failed attempts"
105
- amount_to_clear: str = "amount to clear"
106
- application_context_name: str = "application context name"
107
- array_object_list: str = "array object list"
108
- associated_partners_id: str = "associated partners id"
109
- association_status: str = "association status"
110
- authentication_keys: str = "authentication keys"
111
- authentication_mechanism_name: str = "authentication mechanism name"
112
- authentication_method: str = "authentication method"
113
- avail_baud: str = "avail baud"
114
- available_credit: str = "available credit"
115
- base_node_address: str = "base node address"
116
- broadcast_frames_counter: str = "broadcast frames counter"
117
- buffer: str = "buffer"
118
- bus_address: str = "bus address"
119
- busy_state_timer: str = "busy state timer"
120
- calendar_name_active: str = "calendar name active"
121
- calendar_name_passive: str = "calendar name passive"
122
- calling_window: str = "calling window"
123
- capture: str = "capture"
124
- capture_definition: str = "capture definition"
125
- capture_method: str = "capture method"
126
- capture_objects: str = "capture objects"
127
- capture_period: str = "capture period"
128
- capture_time: str = "capture time"
129
- cell_info: str = "cell info"
130
- certificates: str = "certificates"
131
- change_HLS_secret: str = "change HLS secret"
132
- change_secret: str = "change secret"
133
- changed_parameter: str = "changed parameter"
134
- channel_Id: str = "channel Id"
135
- charge_configuration: str = "charge configuration"
136
- charge_reference_list: str = "charge reference list"
137
- charge_type: str = "charge type"
138
- clearance_threshold: str = "clearance threshold"
139
- client_key: str = "client key"
140
- client_system_title: str = "client system title"
141
- clock_base: str = "clock base"
142
- close_account: str = "close account"
143
- collect: str = "collect"
144
- comm_speed: str = "comm speed"
145
- communication_window: str = "communication window"
146
- compact_buffer: str = "compact buffer"
147
- configuration: str = "configuration"
148
- confirmation_parameters: str = "confirmation parameters"
149
- connect: str = "connect"
150
- connect_logical_device: str = "connect logical device"
151
- control_mode: str = "control mode"
152
- control_state: str = "control state"
153
- credit_available_threshold: str = "credit available threshold"
154
- credit_charge_configuration: str = "credit charge configuration"
155
- credit_configuration: str = "credit configuration"
156
- credit_reference_list: str = "credit reference list"
157
- credit_status: str = "credit status"
158
- credit_type: str = "credit type"
159
- cs_attachment: str = "cs attachment"
160
- cumulative_failed_attempts: str = "cumulative failed attempts"
161
- currency: str = "currency"
162
- current_average_value: str = "current average value"
163
- current_credit_amount: str = "current credit amount"
164
- current_credit_in_use: str = "current credit in use"
165
- current_credit_status: str = "current credit status"
166
- current_user: str = "current user"
167
- data_send: str = "data send"
168
- day_profile_table_active: str = "day profile table active"
169
- day_profile_table_passive: str = "day profile table passive"
170
- daylight_savings_begin: str = "daylight savings begin"
171
- daylight_savings_deviation: str = "daylight savings deviation"
172
- daylight_savings_enabled: str = "daylight savings enabled"
173
- daylight_savings_end: str = "daylight savings end"
174
- default_baud: str = "default baud"
175
- default_mode: str = "default mode"
176
- delete: str = "delete"
177
- delete_authentication_key: str = "delete authentication key"
178
- delete_mask: str = "delete mask"
179
- delete_mc_IP_address: str = "delete mc IP address"
180
- delete_parameter: str = "delete parameter"
181
- delta_electrical_phase: str = "delta electrical phase"
182
- destination_list: str = "destination list"
183
- desynchronization_listing: str = "desynchronization listing"
184
- device_addr: str = "device addr"
185
- device_address: str = "device address"
186
- device_type: str = "device type"
187
- emergency_profile: str = "emergency profile"
188
- emergency_profile_active: str = "emergency profile active"
189
- emergency_profile_group_id_list: str = "emergency profile group id list"
190
- enable_disable: str = "enable disable"
191
- encryption_key_status: str = "encryption key status"
192
- enter: str = "enter"
193
- entries: str = "entries"
194
- entries_in_use: str = "entries in use"
195
- execute: str = "execute"
196
- executed_script: str = "executed script"
197
- execution_time: str = "execution time"
198
- export_certificate: str = "export certificate"
199
- failed_attempts: str = "failed attempts"
200
- frequencies: str = "frequencies"
201
- function_list: str = "function list"
202
- gateway_IP_address: str = "gateway IP address"
203
- gateway_IPv6_addresses: str = "gateway IPv6 addresses"
204
- generate_certificate_request: str = "generate certificate request"
205
- generate_key_pair: str = "generate key pair"
206
- get_nbof_mc_IP_addresses: str = "get nbof mc IP addresses"
207
- get_protected_attributes: str = "get protected attributes"
208
- global_key_transfer: str = "global key transfer"
209
- hash_algorithm_id: str = "hash algorithm id"
210
- identification_number: str = "identification number"
211
- image_activate: str = "image activate"
212
- image_block_size: str = "image block size"
213
- image_block_transfer: str = "image block transfer"
214
- image_first_not_transferred_block_number: str = "image first not transferred block number"
215
- image_to_activate_info: str = "image to activate info"
216
- image_transfer_enabled: str = "image transfer enabled"
217
- image_transfer_initiate: str = "image transfer initiate"
218
- image_transfer_status: str = "image transfer status"
219
- image_transferred_blocks_status: str = "image transferred blocks status"
220
- image_verify: str = "image verify"
221
- import_certificate: str = "import certificate"
222
- inactivity_time_out: str = "inactivity time out"
223
- initial_lockout_time: str = "initial lockout time"
224
- initialization_string: str = "initialization string"
225
- initiator_electrical_phase: str = "initiator electrical phase"
226
- initiator_mac_address: str = "initiator mac address"
227
- insert: str = "insert"
228
- insert_entry: str = "insert entry"
229
- inter_octet_time_out: str = "inter octet time out"
230
- invoke_credit: str = "invoke credit"
231
- invoke_protected_method: str = "invoke protected method"
232
- key_agreement: str = "key agreement"
233
- key_transfer: str = "key transfer"
234
- last_average_value: str = "last average value"
235
- last_collection_amount: str = "last collection amount"
236
- last_collection_time: str = "last collection time"
237
- last_confirmation_date_time: str = "last confirmation date time"
238
- last_outcome: str = "last outcome"
239
- length: str = "length"
240
- limit: str = "limit"
241
- link_status: str = "link status"
242
- list_of_allowed_callers: str = "list of allowed callers"
243
- listening_window: str = "listening window"
244
- logical_name: str = "logical name"
245
- login_password: str = "login password"
246
- low_credit_threshold: str = "low credit threshold"
247
- mac_LNID: str = "mac LNID"
248
- mac_LSID: str = "mac LSID"
249
- mac_SID: str = "mac SID"
250
- mac_SNA: str = "mac SNA"
251
- mac_address: str = "mac address"
252
- mac_beacon_rx_frequency: str = "mac beacon rx frequency"
253
- mac_beacon_rx_slot: str = "mac beacon rx slot"
254
- mac_beacon_slot_count: str = "mac beacon slot count"
255
- mac_beacon_tx_frequency: str = "mac beacon tx frequency"
256
- mac_beacon_tx_slot: str = "mac beacon tx slot"
257
- mac_beacons_per_frame: str = "mac beacons per frame"
258
- mac_capabilities: str = "mac capabilities"
259
- mac_csma_ch_busy_count: str = "mac csma ch busy count"
260
- mac_csma_fail_count: str = "mac csma fail count"
261
- mac_ctl_re_tx_timer: str = "mac ctl re tx timer"
262
- mac_group_addresses: str = "mac group addresses"
263
- mac_max_ctl_re_tx: str = "mac max ctl re tx"
264
- mac_max_promotion_pdu: str = "mac max promotion pdu"
265
- mac_min_switch_search_time: str = "mac min switch search time"
266
- mac_node_hierarchy_level: str = "mac node hierarchy level"
267
- mac_promotion_pdu_tx_period: str = "mac promotion pdu tx period"
268
- mac_rx_ctrl_pkt_count: str = "mac rx ctrl pkt count"
269
- mac_rx_data_pkt_count: str = "mac rx data pkt count"
270
- mac_scp_length: str = "mac scp length"
271
- mac_scp_max_tx_attempts: str = "mac scp max tx attempts"
272
- mac_state: str = "mac state"
273
- mac_tx_ctrl_pkt_count: str = "mac tx ctrl pkt count"
274
- mac_tx_data_pkt_count: str = "mac tx data pkt count"
275
- manufacturer_id: str = "manufacturer id"
276
- mapping_table: str = "mapping table"
277
- mask_list: str = "mask list"
278
- max_frame_length: str = "max frame length"
279
- max_info_field_length_receive: str = "max info field length receive"
280
- max_info_field_length_transmit: str = "max info field length transmit"
281
- max_lockout_time: str = "max lockout time"
282
- max_number_transmissions_n2: str = "max number transmissions n2"
283
- max_number_transmissions_n4: str = "max number transmissions n4"
284
- max_octets_acn_pdu_n3: str = "max octets acn pdu n3"
285
- max_octets_i_pdu_n1: str = "max octets i pdu n1"
286
- max_octets_ui_pdu: str = "max octets ui pdu"
287
- max_pdu_size: str = "max pdu size"
288
- max_provision: str = "max provision"
289
- max_provision_period: str = "max provision period"
290
- max_receiving_gain: str = "max receiving gain"
291
- max_transmitting_gain: str = "max transmitting gain"
292
- mbus_port_reference: str = "mbus port reference"
293
- metrological_identification: str = "metrological identification"
294
- min_delta_credit: str = "min delta credit"
295
- min_over_threshold_duration: str = "min over threshold duration"
296
- min_under_threshold_duration: str = "min under threshold duration"
297
- mode: str = "mode"
298
- modem_profile: str = "modem profile"
299
- monitored_value: str = "monitored value"
300
- most_recent_requests_table: str = "most recent requests table"
301
- multicast_IP_address: str = "multicast IP address"
302
- multicast_IPv6_addresses: str = "multicast IPv6 addresses"
303
- nb_of_sim_conn: str = "nb of sim conn"
304
- neighbor_discovery_setup: str = "neighbor discovery setup"
305
- next_credit_available_threshold: str = "next credit available threshold"
306
- next_period: str = "next period"
307
- number_of_calls: str = "number of calls"
308
- number_of_periods: str = "number of periods"
309
- number_of_retries: str = "number of retries"
310
- number_of_rings: str = "number of rings"
311
- object_list: str = "object list"
312
- operator: str = "operator"
313
- output_state: str = "output state"
314
- output_type: str = "output type"
315
- p_bit_timer: str = "p bit timer"
316
- parameter_list: str = "parameter list"
317
- parameter_list_name: str = "parameter list name"
318
- parameter_value_digest: str = "parameter value digest"
319
- parameter_values: str = "parameter values"
320
- pass_p1: str = "pass p1"
321
- pass_p2: str = "pass p2"
322
- pass_w5: str = "pass w5"
323
- period: str = "period"
324
- permission_table: str = "permission table"
325
- phy_stats_crc_fail_count: str = "phy stats crc fail count"
326
- phy_stats_crc_incorrect_count: str = "phy stats crc incorrect count"
327
- phy_stats_rx_drop_count: str = "phy stats rx drop count"
328
- phy_stats_tx_drop_count: str = "phy stats tx drop count"
329
- port_reference: str = "port reference"
330
- preset_adjusting_time: str = "preset adjusting time"
331
- preset_credit_amount: str = "preset credit amount"
332
- primary_DNS_address: str = "primary DNS address"
333
- primary_address: str = "primary address"
334
- primary_address_list: str = "primary address list"
335
- priority: str = "priority"
336
- processed_value: str = "processed value"
337
- processed_value_actions: str = "processed value actions"
338
- processed_value_thresholds: str = "processed value thresholds"
339
- profile_entries: str = "profile entries"
340
- prop_baud: str = "prop baud"
341
- proportion: str = "proportion"
342
- protection_buffer: str = "protection buffer"
343
- protection_mode: str = "protection mode"
344
- protection_object_list: str = "protection object list"
345
- protection_parameters_get: str = "protection parameters get"
346
- protection_parameters_set: str = "protection parameters set"
347
- protection_status: str = "protection status"
348
- ps_status: str = "ps status"
349
- push: str = "push"
350
- push_client_sap: str = "push client sap"
351
- push_object_list: str = "push object list"
352
- push_operation_method: str = "push operation method"
353
- push_protection_parameters: str = "push protection parameters"
354
- quality_of_service: str = "quality of service"
355
- randomisation_start_interval: str = "randomisation start interval"
356
- raw_value: str = "raw value"
357
- raw_value_actions: str = "raw value actions"
358
- raw_value_thresholds: str = "raw value thresholds"
359
- read_by_logicalname: str = "read by logical name"
360
- receive_lifetime_var_t2: str = "receive lifetime var t2"
361
- receive_window_size_rw: str = "receive window size rw"
362
- received_signal_strength: str = "received signal strength"
363
- register_assignment: str = "register assignment"
364
- reject_timer: str = "reject timer"
365
- remote_disconnect: str = "remote disconnect"
366
- remote_reconnect: str = "remote reconnect"
367
- remove_IPv6_address: str = "remove IPv6 address"
368
- remove_certificate: str = "remove certificate"
369
- remove_entries: str = "remove entries"
370
- remove_function: str = "remove function"
371
- remove_object: str = "remove object"
372
- remove_user: str = "remove user"
373
- repeater: str = "repeater"
374
- repeater_status: str = "repeater status"
375
- repetition_delay: str = "repetition delay"
376
- repetitions: str = "repetitions"
377
- repetitions_counter: str = "repetitions counter"
378
- reply_status_list: str = "reply status list"
379
- reply_to_HLS_authentication: str = "reply to HLS authentication"
380
- reporting_system_list: str = "reporting system list"
381
- request_action: str = "request action"
382
- required_protection: str = "required protection"
383
- reset: str = "reset"
384
- reset_NEW_not_synchronized: str = "reset NEW not synchronized"
385
- reset_account: str = "reset account"
386
- reset_alarm: str = "reset alarm"
387
- response_time: str = "response time"
388
- retrieve_entries: str = "retrieve entries"
389
- retrieve_number_of_entries: str = "retrieve number of entries"
390
- scaler_unit: str = "scaler unit"
391
- scripts: str = "scripts"
392
- sealing_method: str = "sealing method"
393
- search_initiator_threshold: str = "search initiator threshold"
394
- search_initiator_timeout: str = "search initiator timeout"
395
- season_profile_active: str = "season profile active"
396
- season_profile_passive: str = "season profile passive"
397
- secondary_DNS_address: str = "secondary DNS address"
398
- secret: str = "secret"
399
- security_activate: str = "security activate"
400
- security_policy: str = "security policy"
401
- security_setup_reference: str = "security setup reference"
402
- security_suite: str = "security suite"
403
- send_destination_and_method: str = "send destination and method"
404
- sender_address: str = "sender address"
405
- serial_number: str = "serial number"
406
- server_address: str = "server address"
407
- server_port: str = "server port"
408
- server_system_title: str = "server system title"
409
- service_node_address: str = "service node address"
410
- set_amount_to_value: str = "set amount to value"
411
- set_encryption_key: str = "set encryption key"
412
- set_function_status: str = "set function status"
413
- set_protected_attributes: str = "set protected attributes"
414
- set_total_amount_remaining: str = "set total amount remaining"
415
- shift_time: str = "shift time"
416
- slave_deinstall: str = "slave deinstall"
417
- slave_install: str = "slave install"
418
- sort_method: str = "sort method"
419
- sort_object: str = "sort object"
420
- start_time_current: str = "start time current"
421
- status: str = "status"
422
- status_word: str = "status word"
423
- steepness_factor: str = "steepness factor"
424
- subnet_mask: str = "subnet mask"
425
- synchronization_confirmation_timeout: str = "synchronization confirmation timeout"
426
- synchronization_locked: str = "synchronization locked"
427
- synchronization_register: str = "synchronization register"
428
- synchronize: str = "synchronize"
429
- synchronize_clock: str = "synchronize clock"
430
- tabi_list: str = "tabi list"
431
- table_ID: str = "table ID"
432
- table_cell_definition: str = "table cell definition"
433
- table_cell_values: str = "table cell values"
434
- template_description: str = "template description"
435
- template_id: str = "template id"
436
- threshold_active: str = "threshold active"
437
- threshold_emergency: str = "threshold emergency"
438
- threshold_normal: str = "threshold normal"
439
- thresholds: str = "thresholds"
440
- time: str = "time"
441
- time_out_frame_not_OK: str = "time out frame not OK"
442
- time_out_not_addressed: str = "time out not addressed"
443
- time_zone: str = "time zone"
444
- token: str = "token"
445
- token_delivery_method: str = "token delivery method"
446
- token_description: str = "token description"
447
- token_gateway_configuration: str = "token gateway configuration"
448
- token_status: str = "token status"
449
- token_time: str = "token time"
450
- total_amount_paid: str = "total amount paid"
451
- total_amount_remaining: str = "total amount remaining"
452
- traffic_class: str = "traffic class"
453
- transfer_key: str = "transfer key"
454
- transmission_speed: str = "transmission speed"
455
- transmissions_counter: str = "transmissions counter"
456
- transmit_lifetime_var_t3: str = "transmit lifetime var t3"
457
- transmit_window_size_k: str = "transmit window size k"
458
- type: str = "type"
459
- unicast_IPv6_addresses: str = "unicast IPv6 addresses"
460
- unit_charge_activation_time: str = "unit charge activation time"
461
- unit_charge_active: str = "unit charge active"
462
- unit_charge_passive: str = "unit charge passive"
463
- update_amount: str = "update amount"
464
- update_entry: str = "update entry"
465
- update_total_amount_remaining: str = "update total amount remaining"
466
- update_unit_charge: str = "update unit charge"
467
- use_DHCP_flag: str = "use DHCP flag"
468
- user_list: str = "user list"
469
- user_name: str = "user name"
470
- value: str = "value"
471
- version: str = "version"
472
- warning_threshold: str = "warning threshold"
473
- week_profile_table_active: str = "week profile table active"
474
- week_profile_table_passive: str = "week profile table passive"
475
- weightings_table: str = "weightings table"
476
- windows_size_receive: str = "windows size receive"
477
- windows_size_transmit: str = "windows size transmit"
478
- xDLMS_context_info: str = "xDLMS context info"
479
-
480
-
481
- class Conformance(BaseModel):
482
- reserved_zero: str = "reserved-zero"
483
- general_protection: str = "general-protection"
484
- general_block_transfer: str = "general-block-transfer"
485
- read: str = "read"
486
- write: str = "write"
487
- unconfirmed_write: str = "unconfirmed-write"
488
- reserved_six: str = "reserved-six"
489
- reserved_seven: str = "reserved-seven"
490
- attribute0_supported_with_set: str = "attribute0-supported-with-set"
491
- priority_mgmt_supported: str = "priority-mgmt-supported"
492
- attribute0_supported_with_get: str = "attribute0-supported-with-get"
493
- block_transfer_with_get_or_read: str = "block-transfer-with-get-or-read"
494
- block_transfer_with_set_or_write: str = "block-transfer-with-set-or-write"
495
- block_transfer_with_action: str = "block-transfer-with-action"
496
- multiple_references: str = "multiple-references"
497
- information_report: str = "information-report"
498
- data_notification: str = "data-notification"
499
- access: str = "access"
500
- parameterized_access: str = "parameterized-access"
501
- get: str = "get"
502
- set: str = "set"
503
- selective_access: str = "selective-access"
504
- event_notification: str = "event-notification"
505
- action: str = "action"
506
-
507
-
508
- class Settings(BaseModel):
509
- collection: _Collection = Field(default_factory=_Collection)
510
- report: _Report = Field(default_factory=_Report)
511
- firmwares: list[_Firmware] = Field(default_factory=list)
512
- am_names: _AmNames = Field(default_factory=_AmNames)
513
- class_name: dict[int, str] = Field(default={1: "Data"})
514
-
515
-
516
- if not os.path.isfile(path := ".//config.toml"):
517
- path = F"{os.path.dirname(__file__)}{path}"
518
- elif os.path.isfile(path):
519
- with open(path, "rb") as f:
520
- toml_data = tomllib.load(f)
521
- data = toml_data.get("DLMS", {})
522
- print(f"Find configuration <config.toml> with path: {f}")
523
- settings = Settings(**data)
524
- else:
525
- print("NOT FIND CONFIGURATION: <config.toml>")
526
- toml_data = {}
527
- settings = Settings()
528
-
529
-
530
- # remove in future
531
-
532
-
533
- def version():
534
- return "0.2.0"
535
-
536
-
537
- class Language(Enum):
538
- ENGLISH = 'English'
539
- RUSSIAN = 'Russian'
540
-
541
-
542
- __current_language = Language.RUSSIAN
543
-
544
-
545
- def set_current_language(value: str):
546
- global __current_language
547
- __current_language = Language(value)
548
-
549
-
550
- def get_current_language() -> Language:
551
- return __current_language
1
+ import os
2
+ from pydantic import BaseModel, Field, field_serializer
3
+ import tomllib
4
+ from enum import Enum
5
+ from pathlib import Path
6
+
7
+
8
+ class _ReportStruct(BaseModel):
9
+ """
10
+ Patterns. Use for function get_obj_report. Only for struct. Generate custom struct report instead standart. Where %nxx: n - name of struct element,
11
+ xx - index of struct element; %vxx: v - value of struct element, xx - index of struct element
12
+ """
13
+ DayProfileAction: str = "%n00: %v00 - Тариф: %v02"
14
+
15
+
16
+ class _Report(BaseModel):
17
+ empty: str = "--"
18
+ empty_unit: str = "??"
19
+ scaler_format: str = "{:.3f}"
20
+ struct: _ReportStruct = Field(default_factory=_ReportStruct)
21
+
22
+
23
+ class _Collection(BaseModel):
24
+ path: str = "./Types/"
25
+
26
+
27
+ class _FirmwaresKey(BaseModel):
28
+ codec: str = "ascii"
29
+ value: str = "00000000password"
30
+
31
+
32
+ class _Firmware(BaseModel):
33
+ key: _FirmwaresKey = Field(default_factory=_FirmwaresKey)
34
+ man: str = Field("KPZ")
35
+ path: Path = Field(Path("./Firmwares/firmwares.dat"))
36
+
37
+ @field_serializer("path")
38
+ def serialize1_path(self, path: Path) -> str:
39
+ return str(path)
40
+
41
+
42
+ class _AmNames(BaseModel):
43
+ """all attributes and methods names of classes"""
44
+ APN: str = "APN"
45
+ CRC_NOK_frames_counter: str = "CRC NOK frames counter"
46
+ CRC_OK_frames_counter: str = "CRC OK frames counter"
47
+ DL_reference: str = "DL reference"
48
+ FCS_NOK_frames_counter: str = "FCS NOK frames counter"
49
+ FCS_OK_frames_counter: str = "FCS OK frames counter"
50
+ IPCP_options: str = "IPCP options"
51
+ IP_address: str = "IP address"
52
+ IP_options: str = "IP options"
53
+ IP_reference: str = "IP reference"
54
+ LCP_options: str = "LCP options"
55
+ LLS_secret: str = "LLS secret"
56
+ LTE_network_parameters: str = "LTE network parameters"
57
+ LTE_quality_of_service: str = "LTE quality of service"
58
+ M_Bus_Data_Header_Type: str = "M-Bus Data Header Type"
59
+ MAC_address: str = "MAC address"
60
+ MMS: str = "MMS"
61
+ M_Bus_port_communication_state: str = "M Bus port communication state"
62
+ M_Bus_profile_selection: str = "M Bus profile selection"
63
+ PHY_reference: str = "PHY reference"
64
+ PIN_code: str = "PIN code"
65
+ PPP_authentication: str = "PPP authentication"
66
+ SAP_assignment_list: str = "SAP assignment list"
67
+ TCP_UDP_port: str = "TCP UDP port"
68
+ access_number: str = "access number"
69
+ access_rights_list: str = "access rights list"
70
+ account_activation_time: str = "account activation time"
71
+ account_closure_time: str = "account closure time"
72
+ account_mode_and_status: str = "account mode and status"
73
+ acknowledgement_time_t1: str = "acknowledgement time t1"
74
+ acknowledgement_timer: str = "acknowledgement timer"
75
+ actions: str = "actions"
76
+ activate_account: str = "activate account"
77
+ activate_passive_calendar: str = "activate passive calendar"
78
+ activate_passive_calendar_time: str = "activate passive calendar time"
79
+ activate_passive_unit_charge: str = "activate passive unit charge"
80
+ activated: str = "activated"
81
+ activation_status: str = "activation status"
82
+ active_initiator: str = "active initiator"
83
+ active_mask: str = "active mask"
84
+ add_IPv6_address: str = "add IPv6 address"
85
+ add_authentication_key: str = "add authentication key"
86
+ add_function: str = "add function"
87
+ add_mask: str = "add mask"
88
+ add_mc_IP_address: str = "add mc IP address"
89
+ add_object: str = "add object"
90
+ add_parameter: str = "add parameter"
91
+ add_register: str = "add register"
92
+ add_user: str = "add user"
93
+ addr_state: str = "addr state"
94
+ address_config_mode: str = "address config mode"
95
+ address_mask: str = "address mask"
96
+ adjacent_cell: str = "adjacent cell"
97
+ adjust_to_measuring_period: str = "adjust to measuring period"
98
+ adjust_to_minute: str = "adjust to minute"
99
+ adjust_to_preset_time: str = "adjust to preset time"
100
+ adjust_to_quarter: str = "adjust to quarter"
101
+ adjustment_method: str = "adjustment method"
102
+ aggregated_debt: str = "aggregated debt"
103
+ alarm: str = "alarm"
104
+ allowed_failed_attempts: str = "allowed failed attempts"
105
+ amount_to_clear: str = "amount to clear"
106
+ application_context_name: str = "application context name"
107
+ array_object_list: str = "array object list"
108
+ associated_partners_id: str = "associated partners id"
109
+ association_status: str = "association status"
110
+ authentication_keys: str = "authentication keys"
111
+ authentication_mechanism_name: str = "authentication mechanism name"
112
+ authentication_method: str = "authentication method"
113
+ avail_baud: str = "avail baud"
114
+ available_credit: str = "available credit"
115
+ base_node_address: str = "base node address"
116
+ broadcast_frames_counter: str = "broadcast frames counter"
117
+ buffer: str = "buffer"
118
+ bus_address: str = "bus address"
119
+ busy_state_timer: str = "busy state timer"
120
+ calendar_name_active: str = "calendar name active"
121
+ calendar_name_passive: str = "calendar name passive"
122
+ calling_window: str = "calling window"
123
+ capture: str = "capture"
124
+ capture_definition: str = "capture definition"
125
+ capture_method: str = "capture method"
126
+ capture_objects: str = "capture objects"
127
+ capture_period: str = "capture period"
128
+ capture_time: str = "capture time"
129
+ cell_info: str = "cell info"
130
+ certificates: str = "certificates"
131
+ change_HLS_secret: str = "change HLS secret"
132
+ change_secret: str = "change secret"
133
+ changed_parameter: str = "changed parameter"
134
+ channel_Id: str = "channel Id"
135
+ charge_configuration: str = "charge configuration"
136
+ charge_reference_list: str = "charge reference list"
137
+ charge_type: str = "charge type"
138
+ clearance_threshold: str = "clearance threshold"
139
+ client_key: str = "client key"
140
+ client_system_title: str = "client system title"
141
+ clock_base: str = "clock base"
142
+ close_account: str = "close account"
143
+ collect: str = "collect"
144
+ comm_speed: str = "comm speed"
145
+ communication_window: str = "communication window"
146
+ compact_buffer: str = "compact buffer"
147
+ configuration: str = "configuration"
148
+ confirmation_parameters: str = "confirmation parameters"
149
+ connect: str = "connect"
150
+ connect_logical_device: str = "connect logical device"
151
+ control_mode: str = "control mode"
152
+ control_state: str = "control state"
153
+ credit_available_threshold: str = "credit available threshold"
154
+ credit_charge_configuration: str = "credit charge configuration"
155
+ credit_configuration: str = "credit configuration"
156
+ credit_reference_list: str = "credit reference list"
157
+ credit_status: str = "credit status"
158
+ credit_type: str = "credit type"
159
+ cs_attachment: str = "cs attachment"
160
+ cumulative_failed_attempts: str = "cumulative failed attempts"
161
+ currency: str = "currency"
162
+ current_average_value: str = "current average value"
163
+ current_credit_amount: str = "current credit amount"
164
+ current_credit_in_use: str = "current credit in use"
165
+ current_credit_status: str = "current credit status"
166
+ current_user: str = "current user"
167
+ data_send: str = "data send"
168
+ day_profile_table_active: str = "day profile table active"
169
+ day_profile_table_passive: str = "day profile table passive"
170
+ daylight_savings_begin: str = "daylight savings begin"
171
+ daylight_savings_deviation: str = "daylight savings deviation"
172
+ daylight_savings_enabled: str = "daylight savings enabled"
173
+ daylight_savings_end: str = "daylight savings end"
174
+ default_baud: str = "default baud"
175
+ default_mode: str = "default mode"
176
+ delete: str = "delete"
177
+ delete_authentication_key: str = "delete authentication key"
178
+ delete_mask: str = "delete mask"
179
+ delete_mc_IP_address: str = "delete mc IP address"
180
+ delete_parameter: str = "delete parameter"
181
+ delta_electrical_phase: str = "delta electrical phase"
182
+ destination_list: str = "destination list"
183
+ desynchronization_listing: str = "desynchronization listing"
184
+ device_addr: str = "device addr"
185
+ device_address: str = "device address"
186
+ device_type: str = "device type"
187
+ emergency_profile: str = "emergency profile"
188
+ emergency_profile_active: str = "emergency profile active"
189
+ emergency_profile_group_id_list: str = "emergency profile group id list"
190
+ enable_disable: str = "enable disable"
191
+ encryption_key_status: str = "encryption key status"
192
+ enter: str = "enter"
193
+ entries: str = "entries"
194
+ entries_in_use: str = "entries in use"
195
+ execute: str = "execute"
196
+ executed_script: str = "executed script"
197
+ execution_time: str = "execution time"
198
+ export_certificate: str = "export certificate"
199
+ failed_attempts: str = "failed attempts"
200
+ frequencies: str = "frequencies"
201
+ function_list: str = "function list"
202
+ gateway_IP_address: str = "gateway IP address"
203
+ gateway_IPv6_addresses: str = "gateway IPv6 addresses"
204
+ generate_certificate_request: str = "generate certificate request"
205
+ generate_key_pair: str = "generate key pair"
206
+ get_nbof_mc_IP_addresses: str = "get nbof mc IP addresses"
207
+ get_protected_attributes: str = "get protected attributes"
208
+ global_key_transfer: str = "global key transfer"
209
+ hash_algorithm_id: str = "hash algorithm id"
210
+ identification_number: str = "identification number"
211
+ image_activate: str = "image activate"
212
+ image_block_size: str = "image block size"
213
+ image_block_transfer: str = "image block transfer"
214
+ image_first_not_transferred_block_number: str = "image first not transferred block number"
215
+ image_to_activate_info: str = "image to activate info"
216
+ image_transfer_enabled: str = "image transfer enabled"
217
+ image_transfer_initiate: str = "image transfer initiate"
218
+ image_transfer_status: str = "image transfer status"
219
+ image_transferred_blocks_status: str = "image transferred blocks status"
220
+ image_verify: str = "image verify"
221
+ import_certificate: str = "import certificate"
222
+ inactivity_time_out: str = "inactivity time out"
223
+ initial_lockout_time: str = "initial lockout time"
224
+ initialization_string: str = "initialization string"
225
+ initiator_electrical_phase: str = "initiator electrical phase"
226
+ initiator_mac_address: str = "initiator mac address"
227
+ insert: str = "insert"
228
+ insert_entry: str = "insert entry"
229
+ inter_octet_time_out: str = "inter octet time out"
230
+ invoke_credit: str = "invoke credit"
231
+ invoke_protected_method: str = "invoke protected method"
232
+ key_agreement: str = "key agreement"
233
+ key_transfer: str = "key transfer"
234
+ last_average_value: str = "last average value"
235
+ last_collection_amount: str = "last collection amount"
236
+ last_collection_time: str = "last collection time"
237
+ last_confirmation_date_time: str = "last confirmation date time"
238
+ last_outcome: str = "last outcome"
239
+ length: str = "length"
240
+ limit: str = "limit"
241
+ link_status: str = "link status"
242
+ list_of_allowed_callers: str = "list of allowed callers"
243
+ listening_window: str = "listening window"
244
+ logical_name: str = "logical name"
245
+ login_password: str = "login password"
246
+ low_credit_threshold: str = "low credit threshold"
247
+ mac_LNID: str = "mac LNID"
248
+ mac_LSID: str = "mac LSID"
249
+ mac_SID: str = "mac SID"
250
+ mac_SNA: str = "mac SNA"
251
+ mac_address: str = "mac address"
252
+ mac_beacon_rx_frequency: str = "mac beacon rx frequency"
253
+ mac_beacon_rx_slot: str = "mac beacon rx slot"
254
+ mac_beacon_slot_count: str = "mac beacon slot count"
255
+ mac_beacon_tx_frequency: str = "mac beacon tx frequency"
256
+ mac_beacon_tx_slot: str = "mac beacon tx slot"
257
+ mac_beacons_per_frame: str = "mac beacons per frame"
258
+ mac_capabilities: str = "mac capabilities"
259
+ mac_csma_ch_busy_count: str = "mac csma ch busy count"
260
+ mac_csma_fail_count: str = "mac csma fail count"
261
+ mac_ctl_re_tx_timer: str = "mac ctl re tx timer"
262
+ mac_group_addresses: str = "mac group addresses"
263
+ mac_max_ctl_re_tx: str = "mac max ctl re tx"
264
+ mac_max_promotion_pdu: str = "mac max promotion pdu"
265
+ mac_min_switch_search_time: str = "mac min switch search time"
266
+ mac_node_hierarchy_level: str = "mac node hierarchy level"
267
+ mac_promotion_pdu_tx_period: str = "mac promotion pdu tx period"
268
+ mac_rx_ctrl_pkt_count: str = "mac rx ctrl pkt count"
269
+ mac_rx_data_pkt_count: str = "mac rx data pkt count"
270
+ mac_scp_length: str = "mac scp length"
271
+ mac_scp_max_tx_attempts: str = "mac scp max tx attempts"
272
+ mac_state: str = "mac state"
273
+ mac_tx_ctrl_pkt_count: str = "mac tx ctrl pkt count"
274
+ mac_tx_data_pkt_count: str = "mac tx data pkt count"
275
+ manufacturer_id: str = "manufacturer id"
276
+ mapping_table: str = "mapping table"
277
+ mask_list: str = "mask list"
278
+ max_frame_length: str = "max frame length"
279
+ max_info_field_length_receive: str = "max info field length receive"
280
+ max_info_field_length_transmit: str = "max info field length transmit"
281
+ max_lockout_time: str = "max lockout time"
282
+ max_number_transmissions_n2: str = "max number transmissions n2"
283
+ max_number_transmissions_n4: str = "max number transmissions n4"
284
+ max_octets_acn_pdu_n3: str = "max octets acn pdu n3"
285
+ max_octets_i_pdu_n1: str = "max octets i pdu n1"
286
+ max_octets_ui_pdu: str = "max octets ui pdu"
287
+ max_pdu_size: str = "max pdu size"
288
+ max_provision: str = "max provision"
289
+ max_provision_period: str = "max provision period"
290
+ max_receiving_gain: str = "max receiving gain"
291
+ max_transmitting_gain: str = "max transmitting gain"
292
+ mbus_port_reference: str = "mbus port reference"
293
+ metrological_identification: str = "metrological identification"
294
+ min_delta_credit: str = "min delta credit"
295
+ min_over_threshold_duration: str = "min over threshold duration"
296
+ min_under_threshold_duration: str = "min under threshold duration"
297
+ mode: str = "mode"
298
+ modem_profile: str = "modem profile"
299
+ monitored_value: str = "monitored value"
300
+ most_recent_requests_table: str = "most recent requests table"
301
+ multicast_IP_address: str = "multicast IP address"
302
+ multicast_IPv6_addresses: str = "multicast IPv6 addresses"
303
+ nb_of_sim_conn: str = "nb of sim conn"
304
+ neighbor_discovery_setup: str = "neighbor discovery setup"
305
+ next_credit_available_threshold: str = "next credit available threshold"
306
+ next_period: str = "next period"
307
+ number_of_calls: str = "number of calls"
308
+ number_of_periods: str = "number of periods"
309
+ number_of_retries: str = "number of retries"
310
+ number_of_rings: str = "number of rings"
311
+ object_list: str = "object list"
312
+ operator: str = "operator"
313
+ output_state: str = "output state"
314
+ output_type: str = "output type"
315
+ p_bit_timer: str = "p bit timer"
316
+ parameter_list: str = "parameter list"
317
+ parameter_list_name: str = "parameter list name"
318
+ parameter_value_digest: str = "parameter value digest"
319
+ parameter_values: str = "parameter values"
320
+ pass_p1: str = "pass p1"
321
+ pass_p2: str = "pass p2"
322
+ pass_w5: str = "pass w5"
323
+ period: str = "period"
324
+ permission_table: str = "permission table"
325
+ phy_stats_crc_fail_count: str = "phy stats crc fail count"
326
+ phy_stats_crc_incorrect_count: str = "phy stats crc incorrect count"
327
+ phy_stats_rx_drop_count: str = "phy stats rx drop count"
328
+ phy_stats_tx_drop_count: str = "phy stats tx drop count"
329
+ port_reference: str = "port reference"
330
+ preset_adjusting_time: str = "preset adjusting time"
331
+ preset_credit_amount: str = "preset credit amount"
332
+ primary_DNS_address: str = "primary DNS address"
333
+ primary_address: str = "primary address"
334
+ primary_address_list: str = "primary address list"
335
+ priority: str = "priority"
336
+ processed_value: str = "processed value"
337
+ processed_value_actions: str = "processed value actions"
338
+ processed_value_thresholds: str = "processed value thresholds"
339
+ profile_entries: str = "profile entries"
340
+ prop_baud: str = "prop baud"
341
+ proportion: str = "proportion"
342
+ protection_buffer: str = "protection buffer"
343
+ protection_mode: str = "protection mode"
344
+ protection_object_list: str = "protection object list"
345
+ protection_parameters_get: str = "protection parameters get"
346
+ protection_parameters_set: str = "protection parameters set"
347
+ protection_status: str = "protection status"
348
+ ps_status: str = "ps status"
349
+ push: str = "push"
350
+ push_client_sap: str = "push client sap"
351
+ push_object_list: str = "push object list"
352
+ push_operation_method: str = "push operation method"
353
+ push_protection_parameters: str = "push protection parameters"
354
+ quality_of_service: str = "quality of service"
355
+ randomisation_start_interval: str = "randomisation start interval"
356
+ raw_value: str = "raw value"
357
+ raw_value_actions: str = "raw value actions"
358
+ raw_value_thresholds: str = "raw value thresholds"
359
+ read_by_logicalname: str = "read by logical name"
360
+ receive_lifetime_var_t2: str = "receive lifetime var t2"
361
+ receive_window_size_rw: str = "receive window size rw"
362
+ received_signal_strength: str = "received signal strength"
363
+ register_assignment: str = "register assignment"
364
+ reject_timer: str = "reject timer"
365
+ remote_disconnect: str = "remote disconnect"
366
+ remote_reconnect: str = "remote reconnect"
367
+ remove_IPv6_address: str = "remove IPv6 address"
368
+ remove_certificate: str = "remove certificate"
369
+ remove_entries: str = "remove entries"
370
+ remove_function: str = "remove function"
371
+ remove_object: str = "remove object"
372
+ remove_user: str = "remove user"
373
+ repeater: str = "repeater"
374
+ repeater_status: str = "repeater status"
375
+ repetition_delay: str = "repetition delay"
376
+ repetitions: str = "repetitions"
377
+ repetitions_counter: str = "repetitions counter"
378
+ reply_status_list: str = "reply status list"
379
+ reply_to_HLS_authentication: str = "reply to HLS authentication"
380
+ reporting_system_list: str = "reporting system list"
381
+ request_action: str = "request action"
382
+ required_protection: str = "required protection"
383
+ reset: str = "reset"
384
+ reset_NEW_not_synchronized: str = "reset NEW not synchronized"
385
+ reset_account: str = "reset account"
386
+ reset_alarm: str = "reset alarm"
387
+ response_time: str = "response time"
388
+ retrieve_entries: str = "retrieve entries"
389
+ retrieve_number_of_entries: str = "retrieve number of entries"
390
+ scaler_unit: str = "scaler unit"
391
+ scripts: str = "scripts"
392
+ sealing_method: str = "sealing method"
393
+ search_initiator_threshold: str = "search initiator threshold"
394
+ search_initiator_timeout: str = "search initiator timeout"
395
+ season_profile_active: str = "season profile active"
396
+ season_profile_passive: str = "season profile passive"
397
+ secondary_DNS_address: str = "secondary DNS address"
398
+ secret: str = "secret"
399
+ security_activate: str = "security activate"
400
+ security_policy: str = "security policy"
401
+ security_setup_reference: str = "security setup reference"
402
+ security_suite: str = "security suite"
403
+ send_destination_and_method: str = "send destination and method"
404
+ sender_address: str = "sender address"
405
+ serial_number: str = "serial number"
406
+ server_address: str = "server address"
407
+ server_port: str = "server port"
408
+ server_system_title: str = "server system title"
409
+ service_node_address: str = "service node address"
410
+ set_amount_to_value: str = "set amount to value"
411
+ set_encryption_key: str = "set encryption key"
412
+ set_function_status: str = "set function status"
413
+ set_protected_attributes: str = "set protected attributes"
414
+ set_total_amount_remaining: str = "set total amount remaining"
415
+ shift_time: str = "shift time"
416
+ slave_deinstall: str = "slave deinstall"
417
+ slave_install: str = "slave install"
418
+ sort_method: str = "sort method"
419
+ sort_object: str = "sort object"
420
+ start_time_current: str = "start time current"
421
+ status: str = "status"
422
+ status_word: str = "status word"
423
+ steepness_factor: str = "steepness factor"
424
+ subnet_mask: str = "subnet mask"
425
+ synchronization_confirmation_timeout: str = "synchronization confirmation timeout"
426
+ synchronization_locked: str = "synchronization locked"
427
+ synchronization_register: str = "synchronization register"
428
+ synchronize: str = "synchronize"
429
+ synchronize_clock: str = "synchronize clock"
430
+ tabi_list: str = "tabi list"
431
+ table_ID: str = "table ID"
432
+ table_cell_definition: str = "table cell definition"
433
+ table_cell_values: str = "table cell values"
434
+ template_description: str = "template description"
435
+ template_id: str = "template id"
436
+ threshold_active: str = "threshold active"
437
+ threshold_emergency: str = "threshold emergency"
438
+ threshold_normal: str = "threshold normal"
439
+ thresholds: str = "thresholds"
440
+ time: str = "time"
441
+ time_out_frame_not_OK: str = "time out frame not OK"
442
+ time_out_not_addressed: str = "time out not addressed"
443
+ time_zone: str = "time zone"
444
+ token: str = "token"
445
+ token_delivery_method: str = "token delivery method"
446
+ token_description: str = "token description"
447
+ token_gateway_configuration: str = "token gateway configuration"
448
+ token_status: str = "token status"
449
+ token_time: str = "token time"
450
+ total_amount_paid: str = "total amount paid"
451
+ total_amount_remaining: str = "total amount remaining"
452
+ traffic_class: str = "traffic class"
453
+ transfer_key: str = "transfer key"
454
+ transmission_speed: str = "transmission speed"
455
+ transmissions_counter: str = "transmissions counter"
456
+ transmit_lifetime_var_t3: str = "transmit lifetime var t3"
457
+ transmit_window_size_k: str = "transmit window size k"
458
+ type: str = "type"
459
+ unicast_IPv6_addresses: str = "unicast IPv6 addresses"
460
+ unit_charge_activation_time: str = "unit charge activation time"
461
+ unit_charge_active: str = "unit charge active"
462
+ unit_charge_passive: str = "unit charge passive"
463
+ update_amount: str = "update amount"
464
+ update_entry: str = "update entry"
465
+ update_total_amount_remaining: str = "update total amount remaining"
466
+ update_unit_charge: str = "update unit charge"
467
+ use_DHCP_flag: str = "use DHCP flag"
468
+ user_list: str = "user list"
469
+ user_name: str = "user name"
470
+ value: str = "value"
471
+ version: str = "version"
472
+ warning_threshold: str = "warning threshold"
473
+ week_profile_table_active: str = "week profile table active"
474
+ week_profile_table_passive: str = "week profile table passive"
475
+ weightings_table: str = "weightings table"
476
+ windows_size_receive: str = "windows size receive"
477
+ windows_size_transmit: str = "windows size transmit"
478
+ xDLMS_context_info: str = "xDLMS context info"
479
+
480
+
481
+ class Conformance(BaseModel):
482
+ reserved_zero: str = "reserved-zero"
483
+ general_protection: str = "general-protection"
484
+ general_block_transfer: str = "general-block-transfer"
485
+ read: str = "read"
486
+ write: str = "write"
487
+ unconfirmed_write: str = "unconfirmed-write"
488
+ reserved_six: str = "reserved-six"
489
+ reserved_seven: str = "reserved-seven"
490
+ attribute0_supported_with_set: str = "attribute0-supported-with-set"
491
+ priority_mgmt_supported: str = "priority-mgmt-supported"
492
+ attribute0_supported_with_get: str = "attribute0-supported-with-get"
493
+ block_transfer_with_get_or_read: str = "block-transfer-with-get-or-read"
494
+ block_transfer_with_set_or_write: str = "block-transfer-with-set-or-write"
495
+ block_transfer_with_action: str = "block-transfer-with-action"
496
+ multiple_references: str = "multiple-references"
497
+ information_report: str = "information-report"
498
+ data_notification: str = "data-notification"
499
+ access: str = "access"
500
+ parameterized_access: str = "parameterized-access"
501
+ get: str = "get"
502
+ set: str = "set"
503
+ selective_access: str = "selective-access"
504
+ event_notification: str = "event-notification"
505
+ action: str = "action"
506
+
507
+
508
+ class Settings(BaseModel):
509
+ collection: _Collection = Field(default_factory=_Collection)
510
+ report: _Report = Field(default_factory=_Report)
511
+ firmwares: list[_Firmware] = Field(default_factory=list)
512
+ am_names: _AmNames = Field(default_factory=_AmNames)
513
+ class_name: dict[int, str] = Field(default={1: "Data"})
514
+
515
+
516
+ if not os.path.isfile(path := ".//config.toml"):
517
+ path = F"{os.path.dirname(__file__)}{path}"
518
+ elif os.path.isfile(path):
519
+ with open(path, "rb") as f:
520
+ toml_data = tomllib.load(f)
521
+ data = toml_data.get("DLMS", {})
522
+ print(f"Find configuration <config.toml> with path: {f}")
523
+ settings = Settings(**data)
524
+ else:
525
+ print("NOT FIND CONFIGURATION: <config.toml>")
526
+ toml_data = {}
527
+ settings = Settings()
528
+
529
+
530
+ # remove in future
531
+
532
+
533
+ def version():
534
+ return "0.2.0"
535
+
536
+
537
+ class Language(Enum):
538
+ ENGLISH = 'English'
539
+ RUSSIAN = 'Russian'
540
+
541
+
542
+ __current_language = Language.RUSSIAN
543
+
544
+
545
+ def set_current_language(value: str):
546
+ global __current_language
547
+ __current_language = Language(value)
548
+
549
+
550
+ def get_current_language() -> Language:
551
+ return __current_language