mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Update nederlandse_spoorwegen to properly handle punctuality (#31741)
This commit is contained in:
parent
6be0bcceff
commit
2516b9474d
@ -2,7 +2,7 @@
|
|||||||
"domain": "nederlandse_spoorwegen",
|
"domain": "nederlandse_spoorwegen",
|
||||||
"name": "Nederlandse Spoorwegen (NS)",
|
"name": "Nederlandse Spoorwegen (NS)",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/nederlandse_spoorwegen",
|
"documentation": "https://www.home-assistant.io/integrations/nederlandse_spoorwegen",
|
||||||
"requirements": ["nsapi==3.0.2"],
|
"requirements": ["nsapi==3.0.3"],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@YarmoM"]
|
"codeowners": ["@YarmoM"]
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,7 @@ class NSDepartureSensor(Entity):
|
|||||||
"arrival_platform_planned": self._trips[0].arrival_platform_planned,
|
"arrival_platform_planned": self._trips[0].arrival_platform_planned,
|
||||||
"arrival_platform_actual": self._trips[0].arrival_platform_actual,
|
"arrival_platform_actual": self._trips[0].arrival_platform_actual,
|
||||||
"next": None,
|
"next": None,
|
||||||
|
"punctuality": None,
|
||||||
"status": self._trips[0].status.lower(),
|
"status": self._trips[0].status.lower(),
|
||||||
"transfers": self._trips[0].nr_transfers,
|
"transfers": self._trips[0].nr_transfers,
|
||||||
"route": route,
|
"route": route,
|
||||||
@ -190,6 +191,10 @@ class NSDepartureSensor(Entity):
|
|||||||
):
|
):
|
||||||
attributes["arrival_delay"] = True
|
attributes["arrival_delay"] = True
|
||||||
|
|
||||||
|
# Punctuality attributes
|
||||||
|
if self._trips[0].punctuality is not None:
|
||||||
|
attributes["punctuality"] = self._trips[0].punctuality
|
||||||
|
|
||||||
# Next attributes
|
# Next attributes
|
||||||
if len(self._trips) > 1:
|
if len(self._trips) > 1:
|
||||||
if self._trips[1].departure_time_actual is not None:
|
if self._trips[1].departure_time_actual is not None:
|
||||||
|
@ -910,7 +910,7 @@ niko-home-control==0.2.1
|
|||||||
niluclient==0.1.2
|
niluclient==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.nederlandse_spoorwegen
|
# homeassistant.components.nederlandse_spoorwegen
|
||||||
nsapi==3.0.2
|
nsapi==3.0.3
|
||||||
|
|
||||||
# homeassistant.components.nsw_fuel_station
|
# homeassistant.components.nsw_fuel_station
|
||||||
nsw-fuel-api-client==1.0.10
|
nsw-fuel-api-client==1.0.10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user