solax-py-library 1.0.0.2511__py3-none-any.whl → 1.0.0.2513__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.
@@ -3,6 +3,7 @@ import traceback
3
3
  from datetime import datetime
4
4
  from typing import List, Set
5
5
 
6
+ from solax_py_library.smart_scene.core.condition import BaseCondition
6
7
  from solax_py_library.smart_scene.types.action import (
7
8
  SmartSceneAction,
8
9
  )
@@ -22,9 +23,19 @@ from tornado.log import app_log
22
23
 
23
24
 
24
25
  class SmartSceneRunner:
25
- def __init__(self, condition_class_map, action_class_map):
26
- self.condition_class_map = condition_class_map
27
- self.action_class_map = action_class_map
26
+ def __init__(self, condition_classes, action_classes):
27
+ self.condition_class_map = {}
28
+ self.action_class_map = {}
29
+
30
+ for condition_class in condition_classes:
31
+ if not isinstance(condition_class, BaseCondition):
32
+ raise ValueError(
33
+ f"condition({condition_class}) is not derived from BaseCondition"
34
+ )
35
+ self.condition_class_map[condition_class.condition_type] = condition_class
36
+
37
+ for action_class in action_classes:
38
+ self.action_class_map[action_class.action_type] = action_class
28
39
 
29
40
  @staticmethod
30
41
  def _handle_repeat_info(scene_content: SmartSceneContent, once_flag):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: solax-py-library
3
- Version: 1.0.0.2511
3
+ Version: 1.0.0.2513
4
4
  Summary: some common tool
5
5
  Author: shenlvyu
6
6
  Author-email: 13296718439@163.com
@@ -27,7 +27,7 @@ solax_py_library/smart_scene/core/condition/price_condition.py,sha256=mzUnrMuG0D
27
27
  solax_py_library/smart_scene/core/condition/system_condition.py,sha256=g-5LSUAnu7JESUlTRbJ3MKm9cEMzofDZzNNm7_RSy10,1380
28
28
  solax_py_library/smart_scene/core/condition/weather_condition.py,sha256=OiKye007PZnocnmcrNQD6ObOEF7VyaYkdqz6D_2lNok,2236
29
29
  solax_py_library/smart_scene/core/service/__init__.py,sha256=wWzHSN2XaHnI-TNtCJWWRHnNC7s3-2GNQo9y0K_PC4Q,69
30
- solax_py_library/smart_scene/core/service/runner.py,sha256=9hevnzI0wtp4Szxo_EQFeMm0_-iuq5gdmvjbgmyKOz0,5707
30
+ solax_py_library/smart_scene/core/service/runner.py,sha256=SwQ6jb5yFPcyHyfU-THyGDjPEMcNFUOHkvVYA9wB1EE,6201
31
31
  solax_py_library/smart_scene/exceptions/__init__.py,sha256=0hDgr70fFLQB14uorVCwbBhl1yQmZ-uBYGH5XtGm_dg,147
32
32
  solax_py_library/smart_scene/exceptions/price.py,sha256=3bnY6JzeEskUoXVzEs8bpg6hQzgbinBKY4GP4hBITWU,152
33
33
  solax_py_library/smart_scene/exceptions/smart_scene.py,sha256=lIwzjdpvtrAub4lyTQRD3h2sM95vF6gpUy3Nmq1w1k0,1778
@@ -73,6 +73,6 @@ solax_py_library/utils/cloud_client.py,sha256=5dZrc5fzrNFSXqTPZd7oHt-Y9Jj6RCigB7
73
73
  solax_py_library/utils/common.py,sha256=bfnZcX9uM-PjJrYAFv1UMmZgt6bGR7MaOd7jRPNHGxw,1238
74
74
  solax_py_library/utils/struct_util.py,sha256=4SKx5IyAke88PGHPHDK3OEDtyGHdapGoQ1BnGR0F2ts,913
75
75
  solax_py_library/utils/time_util.py,sha256=bY5kj9dmyOuLEQ6uYGQK7jU7y1RMiHZgevEKnkcQcSU,1461
76
- solax_py_library-1.0.0.2511.dist-info/METADATA,sha256=mjGAaaPpdAQpRkr1XwZmuXgVIxN8WwDs-4tK9GAZeWw,1827
77
- solax_py_library-1.0.0.2511.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
78
- solax_py_library-1.0.0.2511.dist-info/RECORD,,
76
+ solax_py_library-1.0.0.2513.dist-info/METADATA,sha256=JVQH6LBB6jAYkL5uwwNDluKZMQXjVGsZopHG8l_GZGM,1827
77
+ solax_py_library-1.0.0.2513.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
78
+ solax_py_library-1.0.0.2513.dist-info/RECORD,,