solax-py-library 1.0.0.36__py3-none-any.whl → 1.0.0.38__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.
@@ -159,17 +159,17 @@ MESSAGE_ENTRY = {
159
159
  "duration": {"zh_CN": "持续: {}秒", "en_US": "Last: {} seconds"},
160
160
  "systemSoc": {"zh_CN": "系统SOC {} {}%", "en_US": "System SOC {} {}%"},
161
161
  "systemImportPower": {
162
- "zh_CN": "电网买电功率 {} {}KW",
163
- "en_US": "Grid import power {} {}KW",
162
+ "zh_CN": "电网买电功率 {} {}kW",
163
+ "en_US": "Grid import power {} {}kW",
164
164
  },
165
165
  "systemExportPower": {
166
- "zh_CN": "电网馈电功率 {} {}KW",
167
- "en_US": "Grid export power {} {}KW",
166
+ "zh_CN": "电网馈电功率 {} {}kW",
167
+ "en_US": "Grid export power {} {}kW",
168
168
  },
169
169
  "cabinetSoc": {"zh_CN": "机柜SOC {} {}%", "en_US": "Cabinet SOC {} {}%"},
170
170
  "EMERGENCY": {"zh_CN": "紧急告警", "en_US": "Emergency alarm"},
171
171
  "TIPS": {"zh_CN": "状态提醒", "en_US": "State Tips"},
172
- "NORMAL": {"zh_CN": "普通告警", "en_US": "Normal alarm"},
172
+ "NORMAL": {"zh_CN": "一般告警", "en_US": "Normal alarm"},
173
173
  "cabinetAlarm": {
174
174
  "zh_CN": "机柜下属({})设备发生{}",
175
175
  "en_US": "The equipments({}) under the cabinet occurs {}",
@@ -36,10 +36,14 @@ class ElePriceCondition(BaseCondition):
36
36
  price = self.value["price"]
37
37
  if None in price[0:96]:
38
38
  return False
39
+ max_num = max(price[0:96])
39
40
  if unit == SmartSceneUnit.NUM: # 比最高电价低X元
40
- base = max(price[0:96]) - value
41
+ base = max_num - value
41
42
  else: # 比最高电价低X%
42
- base = round(max(price[0:96]) * (1 - value / 100), 4)
43
+ if max_num < 0:
44
+ base = round(max_num * (1 + value / 100), 4)
45
+ else:
46
+ base = round(max_num * (1 - value / 100), 4)
43
47
  app_log.info(f"meet_func_highest_price: {base}, data_value: {price[index]}")
44
48
  if price[index] <= base:
45
49
  return True
@@ -51,10 +55,14 @@ class ElePriceCondition(BaseCondition):
51
55
  price = self.value["price"]
52
56
  if None in price[0:96]:
53
57
  return False
58
+ min_num = min(price[0:96])
54
59
  if unit == SmartSceneUnit.NUM: # 比最低电价高X元
55
- base = value + min(price[0:96])
60
+ base = min_num + value
56
61
  else: # 比最低电价高X%
57
- base = round(min(price[0:96]) * (1 + value / 100), 4)
62
+ if min_num < 0:
63
+ base = round(min_num * (1 - value / 100), 4)
64
+ else:
65
+ base = round(min_num * (1 + value / 100), 4)
58
66
  app_log.info(f"meet_func_lowest_price: {base}, data_value: {price[index]}")
59
67
  if price[index] >= base:
60
68
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: solax-py-library
3
- Version: 1.0.0.36
3
+ Version: 1.0.0.38
4
4
  Summary: some common tool
5
5
  Author: shenlvyu
6
6
  Author-email: 13296718439@163.com
@@ -14,7 +14,7 @@ solax_py_library/device/types/modbus_point.py,sha256=YmXe92gWXL_voVXDJE5zzNzr6dp
14
14
  solax_py_library/exception.py,sha256=ygAccdTqJctRrdt9bu6-vqZP5KadfKVS_1tjt4KcRn8,257
15
15
  solax_py_library/smart_scene/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  solax_py_library/smart_scene/constant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- solax_py_library/smart_scene/constant/message_entry.py,sha256=LMlaiK9XsGa7Aaj4KASbNIyZiUnIPNcpz7Vz-BHkZ5w,9717
17
+ solax_py_library/smart_scene/constant/message_entry.py,sha256=cbu2xC5lkhQGvsyDS6ckgQf23tGeCbTJ53a-0s9HuWw,9717
18
18
  solax_py_library/smart_scene/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  solax_py_library/smart_scene/core/action/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  solax_py_library/smart_scene/core/action/base.py,sha256=GlZQTi7ub0fREV5BUZQUTARw3mleWWsKHOA7eFPVoJs,319
@@ -24,7 +24,7 @@ solax_py_library/smart_scene/core/condition/__init__.py,sha256=1nN-N52Oq7LKdn6Ap
24
24
  solax_py_library/smart_scene/core/condition/base.py,sha256=saj7dc0Su2Wi_Lx04cesHFgIPDyQUwvHuDElcaDOIHU,596
25
25
  solax_py_library/smart_scene/core/condition/cabinet_condition.py,sha256=Umum_DvUo6xQDqci4SyiFXw8mpNrkn4l2HdZ4XPVC8c,2039
26
26
  solax_py_library/smart_scene/core/condition/date_condition.py,sha256=ipJo8hvAgeANEwYUSa_O2j4ORc-xhDrJOSuQDMa8-9M,948
27
- solax_py_library/smart_scene/core/condition/price_condition.py,sha256=WEZbVc9RXqayRZS5rFsvBKOKMTOXwEwFhq8KRM5RWbY,4289
27
+ solax_py_library/smart_scene/core/condition/price_condition.py,sha256=yMVRX3gLP7CUYmS-oXRI8GBqoHM8Pi86wht_i8LCQWk,4545
28
28
  solax_py_library/smart_scene/core/condition/system_condition.py,sha256=lEC0N7pZolRkYRcuDfer5jZIvzOGe2ej4oBDlRD8OLQ,1734
29
29
  solax_py_library/smart_scene/core/condition/weather_condition.py,sha256=PkHxQzHwJLZiMsLL4xW8zvghRoQ32TV3vzkNyoF82Ak,2684
30
30
  solax_py_library/smart_scene/core/service/__init__.py,sha256=wWzHSN2XaHnI-TNtCJWWRHnNC7s3-2GNQo9y0K_PC4Q,69
@@ -79,6 +79,6 @@ solax_py_library/utils/cloud_client.py,sha256=5dZrc5fzrNFSXqTPZd7oHt-Y9Jj6RCigB7
79
79
  solax_py_library/utils/common.py,sha256=bfnZcX9uM-PjJrYAFv1UMmZgt6bGR7MaOd7jRPNHGxw,1238
80
80
  solax_py_library/utils/struct_util.py,sha256=pL6L80GXIHasy1ZDIj89-5BzXW1BWI3TPitH7thGGIE,1577
81
81
  solax_py_library/utils/time_util.py,sha256=bY5kj9dmyOuLEQ6uYGQK7jU7y1RMiHZgevEKnkcQcSU,1461
82
- solax_py_library-1.0.0.36.dist-info/METADATA,sha256=TY5e4eFPeqQPmBfTxtq_p0fcvkIJOjYQXJawzawbZuk,1825
83
- solax_py_library-1.0.0.36.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
84
- solax_py_library-1.0.0.36.dist-info/RECORD,,
82
+ solax_py_library-1.0.0.38.dist-info/METADATA,sha256=Un7XTZI5S8Cfzc1ZdSsoxEHk8Gv3CbZsAbm09DyrrXE,1825
83
+ solax_py_library-1.0.0.38.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
84
+ solax_py_library-1.0.0.38.dist-info/RECORD,,