mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Correct type for convert_time_to_isodate (#67846)
This commit is contained in:
parent
d0afc31063
commit
f803c880ae
@ -1,7 +1,7 @@
|
||||
"""Support for HERE travel time sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, time, timedelta
|
||||
import logging
|
||||
|
||||
import herepy
|
||||
@ -443,9 +443,9 @@ class HERETravelTimeData:
|
||||
return attribution
|
||||
|
||||
|
||||
def convert_time_to_isodate(timestr: str) -> str:
|
||||
"""Take a string like 08:00:00 and combine it with the current date."""
|
||||
combined = datetime.combine(dt.start_of_local_day(), dt.parse_time(timestr))
|
||||
def convert_time_to_isodate(simple_time: time) -> str:
|
||||
"""Take a time like 08:00:00 and combine it with the current date."""
|
||||
combined = datetime.combine(dt.start_of_local_day(), simple_time)
|
||||
if combined < datetime.now():
|
||||
combined = combined + timedelta(days=1)
|
||||
return combined.isoformat()
|
||||
|
Loading…
x
Reference in New Issue
Block a user