solax-py-library 1.0.0.34__py3-none-any.whl → 1.0.0.36__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.
@@ -1,5 +1,7 @@
1
1
  from collections import defaultdict
2
2
 
3
+ from tornado.log import app_log
4
+
3
5
  from solax_py_library.smart_scene.core.condition.base import BaseCondition
4
6
  from solax_py_library.smart_scene.types.condition import (
5
7
  CabinetConditionItemData,
@@ -28,6 +30,9 @@ class CabinetCondition(BaseCondition):
28
30
  if data.childType == CabinetConditionType.cabinetSoc:
29
31
  if self.value[cabinet_sn].soc is None:
30
32
  continue
33
+ app_log.info(
34
+ f"meet_cabinet_soc: {self.value[cabinet_sn].soc}, data_value: {condition_data[0]}"
35
+ )
31
36
  if data.childData.function.function()(
32
37
  self.value[cabinet_sn].soc,
33
38
  condition_data[0],
@@ -39,6 +44,9 @@ class CabinetCondition(BaseCondition):
39
44
  alarm_info = cabinet_value.alarm_info(device_type)
40
45
  if not alarm_info:
41
46
  continue
47
+ app_log.info(
48
+ f"meet_cabinet_alarm: {alarm_info}, data_value: {alarm_info[alarm_type-1]}"
49
+ )
42
50
  if alarm_info[alarm_type - 1] is True:
43
51
  return True
44
52
  return False
@@ -1,3 +1,5 @@
1
+ from tornado.log import app_log
2
+
1
3
  from solax_py_library.smart_scene.core.condition.base import BaseCondition
2
4
  from solax_py_library.smart_scene.types.condition import (
3
5
  DateConditionItemData,
@@ -16,6 +18,9 @@ class DateCondition(BaseCondition):
16
18
  if data.childType == DateConditionType.time:
17
19
  date = data.childData.data[0]
18
20
  hour, minute = date.split(":")
21
+ app_log.info(
22
+ f"meet_time: {self.value.get('hour')}, {self.value.get('minute')}, data_value: {date}"
23
+ )
19
24
  if int(hour) == self.value.get("hour") and int(minute) == self.value.get(
20
25
  "minute"
21
26
  ):
@@ -1,5 +1,7 @@
1
1
  from datetime import datetime
2
2
 
3
+ from tornado.log import app_log
4
+
3
5
  from solax_py_library.smart_scene.core.condition.base import BaseCondition
4
6
  from solax_py_library.smart_scene.types.condition import (
5
7
  PriceConditionItemData,
@@ -26,6 +28,7 @@ class ElePriceCondition(BaseCondition):
26
28
  return False
27
29
  if price[index] is None:
28
30
  return False
31
+ app_log.info(f"meet_func_price: {price[index]}, data_value: {data_value[0]}")
29
32
  return function_value.function()(price[index], data_value[0])
30
33
 
31
34
  def meet_func_highest_price(self, data_value, index) -> bool:
@@ -37,6 +40,7 @@ class ElePriceCondition(BaseCondition):
37
40
  base = max(price[0:96]) - value
38
41
  else: # 比最高电价低X%
39
42
  base = round(max(price[0:96]) * (1 - value / 100), 4)
43
+ app_log.info(f"meet_func_highest_price: {base}, data_value: {price[index]}")
40
44
  if price[index] <= base:
41
45
  return True
42
46
  else:
@@ -48,9 +52,10 @@ class ElePriceCondition(BaseCondition):
48
52
  if None in price[0:96]:
49
53
  return False
50
54
  if unit == SmartSceneUnit.NUM: # 比最低电价高X元
51
- base = value - min(price[0:96])
55
+ base = value + min(price[0:96])
52
56
  else: # 比最低电价高X%
53
57
  base = round(min(price[0:96]) * (1 + value / 100), 4)
58
+ app_log.info(f"meet_func_lowest_price: {base}, data_value: {price[index]}")
54
59
  if price[index] >= base:
55
60
  return True
56
61
  else:
@@ -1,3 +1,5 @@
1
+ from tornado.log import app_log
2
+
1
3
  from solax_py_library.smart_scene.core.condition.base import BaseCondition
2
4
  from solax_py_library.smart_scene.types.condition import (
3
5
  SystemConditionItemData,
@@ -22,14 +24,21 @@ class SystemCondition(BaseCondition):
22
24
  compare_value = self.value.get("grid_active_power")
23
25
  if compare_value < 0:
24
26
  return False
27
+ app_log.info(
28
+ f"meet_system_system_export_power: {compare_value}, data_value: {child_data.data[0]}"
29
+ )
25
30
  elif data.childType == SystemConditionType.systemImportPower:
26
31
  compare_value = self.value.get("grid_active_power")
27
32
  if compare_value > 0:
28
33
  return False
34
+ app_log.info(
35
+ f"meet_system_system_import_power: {compare_value}, data_value: {child_data.data[0]}"
36
+ )
29
37
  elif data.childType == SystemConditionType.systemSoc:
30
38
  compare_value = self.value.get("system_soc")
39
+ app_log.info(
40
+ f"meet_system_soc: {compare_value}, data_value: {child_data.data[0]}"
41
+ )
31
42
  if compare_value is None:
32
43
  return False
33
- return function_value.function()(
34
- abs(compare_value), child_data.data[0]
35
- )
44
+ return function_value.function()(abs(compare_value), child_data.data[0])
@@ -1,3 +1,5 @@
1
+ from tornado.log import app_log
2
+
1
3
  from solax_py_library.smart_scene.core.condition.base import BaseCondition
2
4
  from solax_py_library.smart_scene.types.condition import (
3
5
  WeatherConditionItemData,
@@ -33,6 +35,9 @@ class WeatherCondition(BaseCondition):
33
35
  if child_type == WeatherConditionType.irradiance:
34
36
  return self.meet_func_irradiance(function_value, data_value, index)
35
37
  elif child_type == WeatherConditionType.temperature:
38
+ app_log.info(
39
+ f"meet_temperature: {self.value[child_type]['valueList'][index]}, data_value: {data_value[0]}"
40
+ )
36
41
  return function_value.function()(
37
42
  self.value[child_type]["valueList"][index],
38
43
  data_value[0],
@@ -60,6 +65,9 @@ class WeatherCondition(BaseCondition):
60
65
  if not meet_flag:
61
66
  return False
62
67
  # 2. 再判断当前太阳辐照度
68
+ app_log.info(
69
+ f"meet_irradiance: {self.value['irradiance']['valueList'][index]}, data_value: {irradiance}"
70
+ )
63
71
  return function_value.function()(
64
72
  self.value["irradiance"]["valueList"][index], irradiance
65
73
  )
@@ -160,7 +160,7 @@ class SystemConditionItemData(ConditionItemData):
160
160
  )
161
161
 
162
162
  def check_param(self, ctx):
163
- soc_low_limit = ctx.pop("soc_low_limit", 5)
163
+ soc_low_limit = ctx.get("soc_low_limit", 5)
164
164
  if self.childType == SystemConditionType.systemSoc:
165
165
  soc = self.childData.data[0]
166
166
  if soc < soc_low_limit or soc > 100:
@@ -201,7 +201,7 @@ class CabinetConditionItemData(ConditionItemData):
201
201
  )
202
202
 
203
203
  def check_param(self, ctx):
204
- soc_low_limit = ctx.pop("soc_low_limit", 5)
204
+ soc_low_limit = ctx.get("soc_low_limit", 5)
205
205
  if self.childType == CabinetConditionType.cabinetSoc:
206
206
  soc = self.childData.data[0]
207
207
  if soc < soc_low_limit or soc > 100:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: solax-py-library
3
- Version: 1.0.0.34
3
+ Version: 1.0.0.36
4
4
  Summary: some common tool
5
5
  Author: shenlvyu
6
6
  Author-email: 13296718439@163.com
@@ -22,11 +22,11 @@ solax_py_library/smart_scene/core/action/ems_action.py,sha256=sML6qasFoqOktTvEcH
22
22
  solax_py_library/smart_scene/core/action/system_action.py,sha256=oGXq3yXS9nKcGjJActjk0R2Wr3AoO9uoyRPyuiM053g,204
23
23
  solax_py_library/smart_scene/core/condition/__init__.py,sha256=1nN-N52Oq7LKdn6ApKGtSZq5fB1qJzJq8BOKOumfQvY,475
24
24
  solax_py_library/smart_scene/core/condition/base.py,sha256=saj7dc0Su2Wi_Lx04cesHFgIPDyQUwvHuDElcaDOIHU,596
25
- solax_py_library/smart_scene/core/condition/cabinet_condition.py,sha256=3WfF5mxnNuJcQ9O0-5IDkfah7oodKWrvXRV3lftZNNg,1699
26
- solax_py_library/smart_scene/core/condition/date_condition.py,sha256=Xhca6VjoM8Bq-I-dFj1RPLTTzbBL81ORkBnR8D-YqUw,772
27
- solax_py_library/smart_scene/core/condition/price_condition.py,sha256=ToMtTfyJ9hYLY6a0J2Zj4yuCghUq6gzEU42YER1Tbbo,4001
28
- solax_py_library/smart_scene/core/condition/system_condition.py,sha256=FnAhbQ1mGKPbmOR3IDybRig7sPTPg1-byu1a6Y-WPhQ,1313
29
- solax_py_library/smart_scene/core/condition/weather_condition.py,sha256=ZoP5QM0kswQCrb1N22_W358BnhgDc6eXp9XPR5WKAgs,2363
25
+ solax_py_library/smart_scene/core/condition/cabinet_condition.py,sha256=Umum_DvUo6xQDqci4SyiFXw8mpNrkn4l2HdZ4XPVC8c,2039
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
28
+ solax_py_library/smart_scene/core/condition/system_condition.py,sha256=lEC0N7pZolRkYRcuDfer5jZIvzOGe2ej4oBDlRD8OLQ,1734
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
31
31
  solax_py_library/smart_scene/core/service/check.py,sha256=qoNixyjgwHRdb0HnU3UcZDEOeI9t0PxvjZcbgvB79Vs,1031
32
32
  solax_py_library/smart_scene/core/service/runner.py,sha256=SwQ6jb5yFPcyHyfU-THyGDjPEMcNFUOHkvVYA9wB1EE,6201
@@ -36,7 +36,7 @@ solax_py_library/smart_scene/exceptions/smart_scene.py,sha256=69khvoFm1Eki4NBT45
36
36
  solax_py_library/smart_scene/exceptions/weather.py,sha256=bJl1VwiIXEpLQ9VjlVrDoTAIMFqVZdRCas7dtR7eAJc,133
37
37
  solax_py_library/smart_scene/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  solax_py_library/smart_scene/types/action.py,sha256=l2OITe3098-5zrYZSI64yL_YdSXn_FhbMh8h_8wRYBU,12934
39
- solax_py_library/smart_scene/types/condition.py,sha256=D96A0u8tTWmirTmVPtt5b_ewOCf8ntv0DBrSC0Myf_Y,9714
39
+ solax_py_library/smart_scene/types/condition.py,sha256=FSI4JjL2TAeKeyMvTifWv9opha-gCraLhwj5h08vuUo,9714
40
40
  solax_py_library/smart_scene/types/condition_value.py,sha256=CxeDRGWJWZQZTG8KegZBTA6a4ZOCu2CUWyUJBkj94II,1242
41
41
  solax_py_library/smart_scene/types/smart_scene_content.py,sha256=C8H17QEicmDBbxN-m550njwaZyUhAL2hUhlLg3Qj1zM,6061
42
42
  solax_py_library/snap_shot/__init__.py,sha256=Ex12q6BCkdU-3OP-f-ehGCetJJWnoZ7KxhEDd_lXh6M,81
@@ -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.34.dist-info/METADATA,sha256=kXrytbTqBzInoMcyo1EQzO3MKMzl5fmPW7UCpqH4Qto,1825
83
- solax_py_library-1.0.0.34.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
84
- solax_py_library-1.0.0.34.dist-info/RECORD,,
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,,