Fix StationInfo not string in Trafikverket Train (#70153)
This commit is contained in:
parent
ad1241a116
commit
f5318ef6c2
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pytrafikverket import TrafikverketTrain
|
from pytrafikverket import TrafikverketTrain
|
||||||
from pytrafikverket.trafikverket_train import TrainStop
|
from pytrafikverket.trafikverket_train import StationInfo, TrainStop
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
|
@ -166,8 +166,8 @@ class TrainSensor(SensorEntity):
|
||||||
self,
|
self,
|
||||||
train_api: TrafikverketTrain,
|
train_api: TrafikverketTrain,
|
||||||
name: str,
|
name: str,
|
||||||
from_station: str,
|
from_station: StationInfo,
|
||||||
to_station: str,
|
to_station: StationInfo,
|
||||||
weekday: list,
|
weekday: list,
|
||||||
departuretime: time | None,
|
departuretime: time | None,
|
||||||
entry_id: str,
|
entry_id: str,
|
||||||
|
@ -188,7 +188,7 @@ class TrainSensor(SensorEntity):
|
||||||
configuration_url="https://api.trafikinfo.trafikverket.se/",
|
configuration_url="https://api.trafikinfo.trafikverket.se/",
|
||||||
)
|
)
|
||||||
self._attr_unique_id = create_unique_id(
|
self._attr_unique_id = create_unique_id(
|
||||||
from_station, to_station, departuretime, weekday
|
from_station.name, to_station.name, departuretime, weekday
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_update(self) -> None:
|
async def async_update(self) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue