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