Skip to content

Commit 6850a74

Browse files
committed
Fix protocol support for clock set request
1 parent d96f780 commit 6850a74

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

plugwise_usb/messages/requests.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -529,21 +529,21 @@ def __init__(
529529
protocol_version: float,
530530
reset: bool = False,
531531
) -> None:
532-
"""Initialize CircleClockSetRequest message object."""
533-
if protocol_version < 2.0:
534-
# FIXME: Define "absoluteHour" variable
535-
raise MessageError("CircleClockSetRequest for protocol version < 2.0 is not supported")
536-
532+
"""Initialize CircleLogDataRequest message object."""
537533
super().__init__(b"0016", mac)
538534
self._reply_identifier = b"0000"
539535
self.priority = Priority.HIGH
540-
passed_days = dt.day - 1
541-
month_minutes = (
542-
(passed_days * DAY_IN_MINUTES)
543-
+ (dt.hour * HOUR_IN_MINUTES)
544-
+ dt.minute
545-
)
546-
this_date = DateTime(dt.year, dt.month, month_minutes)
536+
if protocol_version == 1.0:
537+
pass
538+
# FIXME: Define "absoluteHour" variable
539+
elif protocol_version >= 2.0:
540+
passed_days = dt.day - 1
541+
month_minutes = (
542+
(passed_days * DAY_IN_MINUTES)
543+
+ (dt.hour * HOUR_IN_MINUTES)
544+
+ dt.minute
545+
)
546+
this_date = DateTime(dt.year, dt.month, month_minutes)
547547
this_time = Time(dt.hour, dt.minute, dt.second)
548548
day_of_week = Int(dt.weekday(), 2)
549549
if reset:

0 commit comments

Comments
 (0)