Skip to content

Commit 0f93f4c

Browse files
committed
Responses: line up Int() use
1 parent 02b3555 commit 0f93f4c

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

plugwise_usb/messages/responses.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class NodeSpecificResponse(PlugwiseResponse):
324324
def __init__(self) -> None:
325325
"""Initialize NodeSpecificResponse message object."""
326326
super().__init__(b"0003")
327-
self.status = Int(0, 4)
327+
self.status = Int(0, length=4)
328328
self._params += [self.status]
329329

330330

@@ -338,8 +338,8 @@ class CirclePlusConnectResponse(PlugwiseResponse):
338338
def __init__(self) -> None:
339339
"""Initialize CirclePlusConnectResponse message object."""
340340
super().__init__(b"0005")
341-
self.existing = Int(0, 2)
342-
self.allowed = Int(0, 2)
341+
self.existing = Int(0, length=2)
342+
self.allowed = Int(0, length=2)
343343
self._params += [self.existing, self.allowed]
344344

345345

@@ -492,13 +492,13 @@ class CirclePowerUsageResponse(PlugwiseResponse):
492492
def __init__(self, protocol_version: str = "2.3") -> None:
493493
"""Initialize CirclePowerUsageResponse message object."""
494494
super().__init__(b"0013")
495-
self._pulse_1s = Int(0, 4)
496-
self._pulse_8s = Int(0, 4)
497-
self._nanosecond_offset = Int(0, 4)
495+
self._pulse_1s = Int(0, length=4)
496+
self._pulse_8s = Int(0, length=4)
497+
self._nanosecond_offset = Int(0, length=4)
498498
self._params += [self._pulse_1s, self._pulse_8s]
499499
if protocol_version == "2.3":
500-
self._pulse_counter_consumed = Int(0, 8)
501-
self._pulse_counter_produced = Int(0, 8)
500+
self._pulse_counter_consumed = Int(0, length=8)
501+
self._pulse_counter_produced = Int(0, length=8)
502502
self._params += [
503503
self._pulse_counter_consumed,
504504
self._pulse_counter_produced,
@@ -600,7 +600,7 @@ def __init__(self) -> None:
600600
"""Initialize NodeRemoveResponse message object."""
601601
super().__init__(b"001D")
602602
self.node_mac_id = String(None, length=16)
603-
self.status = Int(0, 2)
603+
self.status = Int(0, length=2)
604604
self._params += [self.node_mac_id, self.status]
605605

606606

@@ -749,8 +749,8 @@ def __init__(self) -> None:
749749
super().__init__(b"003F")
750750
self.time = Time()
751751
self.day_of_week = Int(0, 2, False)
752-
self.unknown = Int(0, 2)
753-
self.unknown2 = Int(0, 4)
752+
self.unknown = Int(0, length=2)
753+
self.unknown2 = Int(0, length=4)
754754
self._params += [
755755
self.time,
756756
self.day_of_week,
@@ -771,13 +771,13 @@ def __init__(self) -> None:
771771
"""Initialize CircleEnergyLogsResponse message object."""
772772
super().__init__(b"0049")
773773
self.logdate1 = DateTime()
774-
self.pulses1 = Int(0, 8)
774+
self.pulses1 = Int(0, length=8)
775775
self.logdate2 = DateTime()
776-
self.pulses2 = Int(0, 8)
776+
self.pulses2 = Int(0, length=8)
777777
self.logdate3 = DateTime()
778-
self.pulses3 = Int(0, 8)
778+
self.pulses3 = Int(0, length=8)
779779
self.logdate4 = DateTime()
780-
self.pulses4 = Int(0, 8)
780+
self.pulses4 = Int(0, length=8)
781781
self._logaddr = LogAddr(0, length=8)
782782
self._params += [
783783
self.logdate1,
@@ -961,7 +961,7 @@ class SenseReportResponse(PlugwiseResponse):
961961
def __init__(self) -> None:
962962
"""Initialize SenseReportResponse message object."""
963963
super().__init__(SENSE_REPORT_ID)
964-
self.humidity = Int(0, length=4, negative=False)
964+
self.humidity = Int(0, 4, False)
965965
self.temperature = Int(0, length=4)
966966
self._params += [self.humidity, self.temperature]
967967

0 commit comments

Comments
 (0)