Skip to content

Commit 964f848

Browse files
committed
Raise for unsupported version
1 parent de9d067 commit 964f848

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plugwise_usb/messages/requests.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,17 +534,17 @@ def __init__(
534534
super().__init__(b"0016", mac)
535535
self._reply_identifier = b"0000"
536536
self.priority = Priority.HIGH
537-
if protocol_version == 1.0:
538-
pass
537+
if protocol_version < 2.0:
539538
# FIXME: Define "absoluteHour" variable
540-
elif protocol_version >= 2.0:
541-
passed_days = dt.day - 1
542-
month_minutes = (
543-
(passed_days * DAY_IN_MINUTES)
544-
+ (dt.hour * HOUR_IN_MINUTES)
545-
+ dt.minute
546-
)
547-
this_date = DateTime(dt.year, dt.month, month_minutes)
539+
raise MessageError("Unsupported version of CircleClockSetRequest")
540+
541+
passed_days = dt.day - 1
542+
month_minutes = (
543+
(passed_days * DAY_IN_MINUTES)
544+
+ (dt.hour * HOUR_IN_MINUTES)
545+
+ dt.minute
546+
)
547+
this_date = DateTime(dt.year, dt.month, month_minutes)
548548
this_time = Time(dt.hour, dt.minute, dt.second)
549549
day_of_week = Int(dt.weekday(), 2)
550550
if reset:

0 commit comments

Comments
 (0)