Jelajahi Sumber

Fixed target naming in object constructor

Stan Janssen 4 tahun lalu
induk
melakukan
3f576c2bd7
2 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 1 1
      openleadr/objects.py
  2. 2 2
      test/test_objects.py

+ 1 - 1
openleadr/objects.py

@@ -113,11 +113,11 @@ class Interval:
 @dataclass
 class EventSignal:
     intervals: List[Interval]
-    target: Target
     signal_name: str
     signal_type: str
     signal_id: str
     current_value: float
+    targets: List[Target] = None
 
 @dataclass
 class Event:

+ 2 - 2
test/test_objects.py

@@ -25,9 +25,9 @@ def test_oadr_event():
                     duration=timedelta(minutes=5),
                     uid=1,
                     signal_payload=2)],
-            target=objects.Target(
+            targets=[objects.Target(
                 ven_id='1234'
-            ),
+            )],
             signal_name=enums.SIGNAL_NAME.LOAD_CONTROL,
             signal_type=enums.SIGNAL_TYPE.LEVEL,
             signal_id=1,