Skip to content

Commit e756e99

Browse files
committed
Add more typing
1 parent d307315 commit e756e99

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plugwise/helper.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ def schemas_schedule_temp(schedules, name) -> float | None:
9090
if name == "None":
9191
return # pragma: no cover
9292

93-
schema_list: list[str] | None = [] # ???
93+
schema_list: list[list[int, dt.time, float]] | None = []
9494
for period, temp in schedules[name].items():
95-
tmp_list: list[tuple[str, str, float]] = []
95+
tmp_list: list[int, dt.time, float] = []
9696
moment, dummy = period.split(",")
9797
moment = moment.replace("[", "").split(" ")
98-
day_nr: str = DAYS.get(moment[0], "None")
99-
start_time: dt.datetime = dt.datetime.strptime(moment[1], "%H:%M").time()
98+
day_nr: int = DAYS.get(moment[0], "None")
99+
start_time: dt.time = dt.datetime.strptime(moment[1], "%H:%M").time()
100100
tmp_list.extend((day_nr, start_time, temp))
101101
schema_list.append(tmp_list)
102102

@@ -108,12 +108,12 @@ def schemas_schedule_temp(schedules, name) -> float | None:
108108
return schema_list[0][2]
109109

110110
for i in range(length):
111-
result_1 = schema_list[i][0]
112-
start = schema_list[i][1]
113-
j = (i + 1) % (length - 1)
114-
result_2 = schema_list[j][0]
115-
end = schema_list[j][1]
116-
now = dt.datetime.now().time()
111+
result_1: int = schema_list[i][0]
112+
start: dt.time = schema_list[i][1]
113+
j: int = (i + 1) % (length - 1)
114+
result_2: int = schema_list[j][0]
115+
end: dt.time = schema_list[j][1]
116+
now: dt.time = dt.datetime.now().time()
117117
if (
118118
result_1 == dt.datetime.now().weekday()
119119
or result_2 == dt.datetime.now().weekday()

0 commit comments

Comments
 (0)