solax-py-library 1.0.0.15__py3-none-any.whl → 1.0.0.17__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 (38) hide show
  1. solax_py_library/__init__.py +1 -1
  2. solax_py_library/{upload/errors/base.py → exception.py} +10 -10
  3. solax_py_library/snap_shot/__init__.py +3 -4
  4. solax_py_library/snap_shot/constant/__init__.py +5 -0
  5. solax_py_library/snap_shot/constant/crc_table.py +258 -0
  6. solax_py_library/snap_shot/core/__init__.py +7 -0
  7. solax_py_library/snap_shot/{base_modbus.py → core/base_modbus.py} +14 -14
  8. solax_py_library/snap_shot/{core.py → core/snap_shot.py} +249 -219
  9. solax_py_library/snap_shot/exceptions/__init__.py +3 -0
  10. solax_py_library/snap_shot/exceptions/snap_shot.py +9 -0
  11. solax_py_library/snap_shot/test/__init__.py +0 -0
  12. solax_py_library/snap_shot/types/__init__.py +15 -0
  13. solax_py_library/snap_shot/types/address.py +39 -0
  14. solax_py_library/upload/__init__.py +3 -3
  15. solax_py_library/upload/api/__init__.py +3 -3
  16. solax_py_library/upload/api/service.py +24 -24
  17. solax_py_library/upload/core/__init__.py +3 -3
  18. solax_py_library/upload/core/data_adapter/__init__.py +5 -5
  19. solax_py_library/upload/core/data_adapter/base.py +9 -9
  20. solax_py_library/upload/core/data_adapter/csv.py +26 -26
  21. solax_py_library/upload/core/upload_service/__init__.py +15 -15
  22. solax_py_library/upload/core/upload_service/base.py +43 -43
  23. solax_py_library/upload/core/upload_service/ftp.py +97 -86
  24. solax_py_library/upload/{errors → exceptions}/__init__.py +10 -10
  25. solax_py_library/upload/{errors → exceptions}/upload_error.py +21 -21
  26. solax_py_library/upload/test/test_ftp.py +81 -40
  27. solax_py_library/upload/types/__init__.py +11 -11
  28. solax_py_library/upload/types/client.py +19 -19
  29. solax_py_library/upload/types/ftp.py +37 -37
  30. solax_py_library/utils/__init__.py +0 -0
  31. solax_py_library/{snap_shot/untils.py → utils/common.py} +19 -17
  32. solax_py_library/{snap_shot → utils}/parser.py +225 -224
  33. {solax_py_library-1.0.0.15.dist-info → solax_py_library-1.0.0.17.dist-info}/METADATA +4 -4
  34. solax_py_library-1.0.0.17.dist-info/RECORD +36 -0
  35. {solax_py_library-1.0.0.15.dist-info → solax_py_library-1.0.0.17.dist-info}/WHEEL +1 -1
  36. solax_py_library/snap_shot/address.py +0 -67
  37. solax_py_library/snap_shot/exceptions.py +0 -4
  38. solax_py_library-1.0.0.15.dist-info/RECORD +0 -29
@@ -1 +1 @@
1
- __all__ = ["upload", "snap_shot"]
1
+ __all__ = ["upload", "snap_shot"]
@@ -1,10 +1,10 @@
1
- class UploadBaseError(Exception):
2
- code = 0x1000
3
- message = "upload error"
4
-
5
- def __init__(self, *args, message=None):
6
- super().__init__(*args)
7
- self.message = message or self.message
8
-
9
- def __str__(self):
10
- return self.message
1
+ class SolaxBaseError(Exception):
2
+ code = 0x1000
3
+ message = "upload error"
4
+
5
+ def __init__(self, *args, message=None):
6
+ super().__init__(*args)
7
+ self.message = message or self.message
8
+
9
+ def __str__(self):
10
+ return self.message
@@ -1,4 +1,3 @@
1
- from .core import SnapshotCore
2
- from .parser import Parser
3
-
4
- __all__ = ["SnapshotCore", "Parser"]
1
+ from solax_py_library.utils.parser import Parser
2
+
3
+ __all__ = ["SnapshotCore", "Parser"]
@@ -0,0 +1,5 @@
1
+ from .crc_table import CRC_Table
2
+
3
+ __all__ = [
4
+ "CRC_Table",
5
+ ]
@@ -0,0 +1,258 @@
1
+ CRC_Table = [
2
+ 0x0000,
3
+ 0x8005,
4
+ 0x1800F,
5
+ 0x1000A,
6
+ 0x3801B,
7
+ 0x3001E,
8
+ 0x20014,
9
+ 0x28011,
10
+ 0x78033,
11
+ 0x70036,
12
+ 0x6003C,
13
+ 0x68039,
14
+ 0x40028,
15
+ 0x4802D,
16
+ 0x58027,
17
+ 0x50022,
18
+ 0xF8063,
19
+ 0xF0066,
20
+ 0xE006C,
21
+ 0xE8069,
22
+ 0xC0078,
23
+ 0xC807D,
24
+ 0xD8077,
25
+ 0xD0072,
26
+ 0x80050,
27
+ 0x88055,
28
+ 0x9805F,
29
+ 0x9005A,
30
+ 0xB804B,
31
+ 0xB004E,
32
+ 0xA0044,
33
+ 0xA8041,
34
+ 0x1F80C3,
35
+ 0x1F00C6,
36
+ 0x1E00CC,
37
+ 0x1E80C9,
38
+ 0x1C00D8,
39
+ 0x1C80DD,
40
+ 0x1D80D7,
41
+ 0x1D00D2,
42
+ 0x1800F0,
43
+ 0x1880F5,
44
+ 0x1980FF,
45
+ 0x1900FA,
46
+ 0x1B80EB,
47
+ 0x1B00EE,
48
+ 0x1A00E4,
49
+ 0x1A80E1,
50
+ 0x1000A0,
51
+ 0x1080A5,
52
+ 0x1180AF,
53
+ 0x1100AA,
54
+ 0x1380BB,
55
+ 0x1300BE,
56
+ 0x1200B4,
57
+ 0x1280B1,
58
+ 0x178093,
59
+ 0x170096,
60
+ 0x16009C,
61
+ 0x168099,
62
+ 0x140088,
63
+ 0x14808D,
64
+ 0x158087,
65
+ 0x150082,
66
+ 0x3F8183,
67
+ 0x3F0186,
68
+ 0x3E018C,
69
+ 0x3E8189,
70
+ 0x3C0198,
71
+ 0x3C819D,
72
+ 0x3D8197,
73
+ 0x3D0192,
74
+ 0x3801B0,
75
+ 0x3881B5,
76
+ 0x3981BF,
77
+ 0x3901BA,
78
+ 0x3B81AB,
79
+ 0x3B01AE,
80
+ 0x3A01A4,
81
+ 0x3A81A1,
82
+ 0x3001E0,
83
+ 0x3081E5,
84
+ 0x3181EF,
85
+ 0x3101EA,
86
+ 0x3381FB,
87
+ 0x3301FE,
88
+ 0x3201F4,
89
+ 0x3281F1,
90
+ 0x3781D3,
91
+ 0x3701D6,
92
+ 0x3601DC,
93
+ 0x3681D9,
94
+ 0x3401C8,
95
+ 0x3481CD,
96
+ 0x3581C7,
97
+ 0x3501C2,
98
+ 0x200140,
99
+ 0x208145,
100
+ 0x21814F,
101
+ 0x21014A,
102
+ 0x23815B,
103
+ 0x23015E,
104
+ 0x220154,
105
+ 0x228151,
106
+ 0x278173,
107
+ 0x270176,
108
+ 0x26017C,
109
+ 0x268179,
110
+ 0x240168,
111
+ 0x24816D,
112
+ 0x258167,
113
+ 0x250162,
114
+ 0x2F8123,
115
+ 0x2F0126,
116
+ 0x2E012C,
117
+ 0x2E8129,
118
+ 0x2C0138,
119
+ 0x2C813D,
120
+ 0x2D8137,
121
+ 0x2D0132,
122
+ 0x280110,
123
+ 0x288115,
124
+ 0x29811F,
125
+ 0x29011A,
126
+ 0x2B810B,
127
+ 0x2B010E,
128
+ 0x2A0104,
129
+ 0x2A8101,
130
+ 0x7F8303,
131
+ 0x7F0306,
132
+ 0x7E030C,
133
+ 0x7E8309,
134
+ 0x7C0318,
135
+ 0x7C831D,
136
+ 0x7D8317,
137
+ 0x7D0312,
138
+ 0x780330,
139
+ 0x788335,
140
+ 0x79833F,
141
+ 0x79033A,
142
+ 0x7B832B,
143
+ 0x7B032E,
144
+ 0x7A0324,
145
+ 0x7A8321,
146
+ 0x700360,
147
+ 0x708365,
148
+ 0x71836F,
149
+ 0x71036A,
150
+ 0x73837B,
151
+ 0x73037E,
152
+ 0x720374,
153
+ 0x728371,
154
+ 0x778353,
155
+ 0x770356,
156
+ 0x76035C,
157
+ 0x768359,
158
+ 0x740348,
159
+ 0x74834D,
160
+ 0x758347,
161
+ 0x750342,
162
+ 0x6003C0,
163
+ 0x6083C5,
164
+ 0x6183CF,
165
+ 0x6103CA,
166
+ 0x6383DB,
167
+ 0x6303DE,
168
+ 0x6203D4,
169
+ 0x6283D1,
170
+ 0x6783F3,
171
+ 0x6703F6,
172
+ 0x6603FC,
173
+ 0x6683F9,
174
+ 0x6403E8,
175
+ 0x6483ED,
176
+ 0x6583E7,
177
+ 0x6503E2,
178
+ 0x6F83A3,
179
+ 0x6F03A6,
180
+ 0x6E03AC,
181
+ 0x6E83A9,
182
+ 0x6C03B8,
183
+ 0x6C83BD,
184
+ 0x6D83B7,
185
+ 0x6D03B2,
186
+ 0x680390,
187
+ 0x688395,
188
+ 0x69839F,
189
+ 0x69039A,
190
+ 0x6B838B,
191
+ 0x6B038E,
192
+ 0x6A0384,
193
+ 0x6A8381,
194
+ 0x400280,
195
+ 0x408285,
196
+ 0x41828F,
197
+ 0x41028A,
198
+ 0x43829B,
199
+ 0x43029E,
200
+ 0x420294,
201
+ 0x428291,
202
+ 0x4782B3,
203
+ 0x4702B6,
204
+ 0x4602BC,
205
+ 0x4682B9,
206
+ 0x4402A8,
207
+ 0x4482AD,
208
+ 0x4582A7,
209
+ 0x4502A2,
210
+ 0x4F82E3,
211
+ 0x4F02E6,
212
+ 0x4E02EC,
213
+ 0x4E82E9,
214
+ 0x4C02F8,
215
+ 0x4C82FD,
216
+ 0x4D82F7,
217
+ 0x4D02F2,
218
+ 0x4802D0,
219
+ 0x4882D5,
220
+ 0x4982DF,
221
+ 0x4902DA,
222
+ 0x4B82CB,
223
+ 0x4B02CE,
224
+ 0x4A02C4,
225
+ 0x4A82C1,
226
+ 0x5F8243,
227
+ 0x5F0246,
228
+ 0x5E024C,
229
+ 0x5E8249,
230
+ 0x5C0258,
231
+ 0x5C825D,
232
+ 0x5D8257,
233
+ 0x5D0252,
234
+ 0x580270,
235
+ 0x588275,
236
+ 0x59827F,
237
+ 0x59027A,
238
+ 0x5B826B,
239
+ 0x5B026E,
240
+ 0x5A0264,
241
+ 0x5A8261,
242
+ 0x500220,
243
+ 0x508225,
244
+ 0x51822F,
245
+ 0x51022A,
246
+ 0x53823B,
247
+ 0x53023E,
248
+ 0x520234,
249
+ 0x528231,
250
+ 0x578213,
251
+ 0x570216,
252
+ 0x56021C,
253
+ 0x568219,
254
+ 0x540208,
255
+ 0x54820D,
256
+ 0x558207,
257
+ 0x550202,
258
+ ]
@@ -0,0 +1,7 @@
1
+ from .snap_shot import SnapshotCore
2
+ from .base_modbus import ModbusClientBase
3
+
4
+ __all__ = [
5
+ "SnapshotCore",
6
+ "ModbusClientBase",
7
+ ]
@@ -1,14 +1,14 @@
1
- from abc import ABC, abstractmethod
2
- from typing import List
3
-
4
- class ModbusClientBase(ABC):
5
- @abstractmethod
6
- async def read_registers(self, address: int, quantity_of_x: int) -> List[int]:
7
- """抽象读取寄存器方法"""
8
- pass
9
-
10
- @abstractmethod
11
- async def write_registers(self, address: int, values: List[int]) -> bool:
12
- """抽象写入寄存器方法"""
13
- pass
14
-
1
+ from abc import ABC, abstractmethod
2
+ from typing import List
3
+
4
+
5
+ class ModbusClientBase(ABC):
6
+ @abstractmethod
7
+ async def read_registers(self, address: int, quantity_of_x: int) -> List[int]:
8
+ """抽象读取寄存器方法"""
9
+ pass
10
+
11
+ @abstractmethod
12
+ async def write_registers(self, address: int, values: List[int]) -> bool:
13
+ """抽象写入寄存器方法"""
14
+ pass