1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-27 18:56:26 +01:00
Files
core/homeassistant/components/trafikverket_ferry/util.py
T
Sid ac54cdcdb4 Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00

16 lines
398 B
Python

"""Utils for trafikverket_ferry."""
from __future__ import annotations
from datetime import time
def create_unique_id(
ferry_from: str, ferry_to: str, ferry_time: time | str | None, weekdays: list[str]
) -> str:
"""Create unique id."""
return (
f"{ferry_from.casefold().replace(' ', '')}-{ferry_to.casefold().replace(' ', '')}"
f"-{ferry_time!s}-{weekdays!s}"
)