Home Assistant Unofficial Reference
2024.12.1
util.py
Go to the documentation of this file.
1
"""Utils for trafikverket_ferry."""
2
3
from
__future__
import
annotations
4
5
from
datetime
import
time
6
7
8
def
create_unique_id
(
9
ferry_from: str, ferry_to: str, ferry_time: time | str |
None
, weekdays: list[str]
10
) -> str:
11
"""Create unique id."""
12
return
(
13
f
"{ferry_from.casefold().replace(' ', '')}-{ferry_to.casefold().replace(' ', '')}"
14
f
"-{ferry_time!s}-{weekdays!s}"
15
)
homeassistant.components.trafikverket_ferry.util.create_unique_id
str create_unique_id(str ferry_from, str ferry_to, time|str|None ferry_time, list[str] weekdays)
Definition:
util.py:10
core
homeassistant
components
trafikverket_ferry
util.py
Generated by
1.9.1