8000 Use tzinfo in time constructor instead of astime for iot devices (#1158) · msz-coder/python-kasa@bd5a24b · GitHub
[go: up one dir, main page]

Skip to content

Commit bd5a24b

Browse files
authored
Use tzinfo in time constructor instead of astime for iot devices (python-kasa#1158)
Fixes using `astime` on a non tzinfo aware object which causes issues with daylight saving.
1 parent 7c1686d commit bd5a24b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kasa/iot/modules/time.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ def time(self) -> datetime:
3737
res["hour"],
3838
res["min"],
3939
res["sec"],
40+
tzinfo=self.timezone,
4041
)
41-
return time.astimezone(self.timezone)
42+
return time
4243

4344
@property
4445
def timezone(self) -> tzinfo:

0 commit comments

Comments
 (0)
0