From b4cb95f5b234412301e26636531b50da73e256b6 Mon Sep 17 00:00:00 2001 From: mark1foley <50077728+mark1foley@users.noreply.github.com> Date: Sun, 23 Oct 2022 11:16:22 +1000 Subject: [PATCH] Fixed bug --- README.md | 2 +- custom_components/gtfs_rt/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16df7b6..441860c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Configuration variables: - **update_frequency** (*Optional*): Frequency (in seconds) that updates occur. Default is 60 - **vehicle_position_url** (*Optional*): Provides live position tracking on the home assistant map - **api_key** (*Optional*): If provided, this key will be sent with API requests in an "Authorization" header. -- **x_api_key** (*Optional*): If provided, this key will be sent with API requests in an "Authorization" header. +- **x_api_key** (*Optional*): If provided, this key will be sent with API requests in an "x_api_key" header. - **route_delimiter** (*Optional*): If provided, the text in the feed's route id before the delimiter is used as the route id. Useful if the provider incorporates calendar ids into their route ids. - **departures** (*Required*): A list of routes and departure locations to watch - **name** (*Required*): The name of the sensor in HA. When displaying on the map card HA generates the name using the first letters of the first 3 words. So, 107Bus shows as "107" on the map. Different labels can be defined when displaying the sensor on an entiry card etc. diff --git a/custom_components/gtfs_rt/sensor.py b/custom_components/gtfs_rt/sensor.py index 8be724b..0904e77 100644 --- a/custom_components/gtfs_rt/sensor.py +++ b/custom_components/gtfs_rt/sensor.py @@ -62,7 +62,7 @@ def due_in_minutes(timestamp): def setup_platform(hass, config, add_devices, discovery_info=None): """Get the public transport sensor.""" - data = PublicTransportData(config.get(CONF_TRIP_UPDATE_URL), config.get(CONF_VEHICLE_POSITION_URL), config.get(CONF_ROUTE_DELIMITER), config.get(CONF_API_KEY, config.get(CONF_X_API_KEY))) + data = PublicTransportData(config.get(CONF_TRIP_UPDATE_URL), config.get(CONF_VEHICLE_POSITION_URL), config.get(CONF_ROUTE_DELIMITER), config.get(CONF_API_KEY), config.get(CONF_X_API_KEY)) sensors = [] for departure in config.get(CONF_DEPARTURES): sensors.append(PublicTransportSensor(