From 4dbdb4fb183ddc123c6589b6c6a7ce594893efbc Mon Sep 17 00:00:00 2001 From: smallship <3186037+smallship@users.noreply.github.com> Date: Sat, 1 Sep 2018 22:06:12 +0100 Subject: [PATCH] Explicitly list available train attributes (#6139) * Explicitly list the available train attributes * A bit more detail on train attributes --- source/_components/sensor.uk_transport.markdown | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/_components/sensor.uk_transport.markdown b/source/_components/sensor.uk_transport.markdown index ccf0c1a5a77..17bebc15dad 100644 --- a/source/_components/sensor.uk_transport.markdown +++ b/source/_components/sensor.uk_transport.markdown @@ -46,7 +46,21 @@ Configuration variables: - **origin** (*Required*): Specify the three character long origin station code. - **destination** (*Required*): Specify the three character long destination station code. -A large amount of information about upcoming departures is available within the attributes of the sensor. The example above creates a sensor with ID `sensor.next_train_to_wat` with the attribute `next_trains` which is a list of the next 25 departing trains. The status of the next departing train is accessed using the [template sensor](/components/sensor.template/) below, as are the train origin, estimated and scheduled departure times, and the departure platform. +A large amount of information about upcoming departures is available within the attributes of the sensor. The example above creates a sensor with ID `sensor.next_train_to_wat` with the attribute `next_trains` which is a list of the next 25 departing trains. + +These attributes are available for each departing train: + +- `origin_name` +- `destination_name` +- `status` +- `scheduled`: (API attribute is `aimed_departure_time`) +- `estimated`: (API attribute is `expected_departure_time`) +- `platform` +- `operator_name` + +Refer to the [API reference webpage](https://developer.transportapi.com/docs?raml=https://transportapi.com/v3/raml/transportapi.raml##request_uk_train_station_station_code_live_json) for definitions. + +Attributes can be accessed using the [template sensor](/components/sensor.template/) as per this example: ```yaml # Example configuration.yaml entry for a template sensor to access the attributes of the next departing train.