From 2453b5c52e75c3b5724511f416b9b6bea678fd35 Mon Sep 17 00:00:00 2001 From: mountainsandcode Date: Thu, 6 Apr 2017 01:17:28 +0200 Subject: [PATCH 1/3] Update mvglive documentation --- source/_components/sensor.mvglive.markdown | 43 ++++++++-------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/source/_components/sensor.mvglive.markdown b/source/_components/sensor.mvglive.markdown index 5d461ad19e34..21bf813bbd4e 100644 --- a/source/_components/sensor.mvglive.markdown +++ b/source/_components/sensor.mvglive.markdown @@ -22,45 +22,34 @@ To enable this sensor, add the following lines to your `configuration.yaml` file # Example configuration.yaml entry sensor: - platform: mvglive - station: STATION_OR_STOP + nextdeparture: + - station: STATION_OR_STOP_NAME ``` Configuration variables: - **station** (*Required*): Name of the stop or station. Visit [the MVG live web site](http://www.mvg-live.de) to find valid names. - - **destination** (*Optional*): Name of the line's final destination to display only connections ending there. - - **line** (*Optional*): Online display connections from this line, e.g. `'U6'`, `'S2'`. - - **offset** (*Optional*): Do not display connections departing sooner than this number of minutes (defaults to 0). Useful if you are a couple of minutes away from the stop. - - **bus** (*Optional*): If 'False', do not display bus connections - - **tram** (*Optional*): If 'False', do not display tram connections - - **ubahn** (*Optional*): If 'False', do not display U-Bahn (subway) connections - - **sbahn** (*Optional*): If 'False', do not display S-Bahn (suburban train) connections - + - **destinations** (*Optional*): One or multiple final stop names, e.g. 'Feldmoching' or ['Feldmoching','Harthof']. This can be used to only consider a particular direction of travel + - **lines** (*Optional*): One or more line numbers, e.g. 'U2' or ['U2','U8','N41'] + - **products** (*Optional*): One or more modes of transport, defaults to all 4 modes ['U-Bahn', 'Tram', 'Bus', 'S-Bahn']. + - **timeoffset** (*Optional*): Do not display connections departing sooner than this number of minutes (defaults to 0). Useful if you are a couple of minutes away from the stop. + - **name** (*Optional*): You can customise the name of the sensor, which defaults to the station name. ## {% linkable_title Examples %} ### {% linkable_title Full configuration %} -The example below shows a full configuration using the 'line' argument. - -```yaml -# Example configuration.yml entry -sensor: - - platform: mvglive - station: Marienplatz - line: U6 - offset: 5 - destination: Garching-Forschungszentrum -``` - -Another example showing all bus connections at the main station. +The example below shows a full configuration with two sensors that showcase the various configuration options. ```yaml # Example configuration.yml entry sensor: - platform: mvglive - station: Hauptbahnhof - offset: 2 - sbahn: False - ubahn: False - tram: False + nextdeparture: + - station: Hauptbahnhof + name: Hbf + destinations: ['München Flughafen Terminal','Markt Schwaben'] + products: 'S-Bahn' + timeoffset: 2 + - station: Scheidplatz + lines: ['U2','U8'] ``` From 186633766e91e0f5f39fe29483f5f5411ae714c3 Mon Sep 17 00:00:00 2001 From: mountainsandcode Date: Thu, 6 Apr 2017 12:38:35 +0200 Subject: [PATCH 2/3] Update sensor.mvglive.markdown --- source/_components/sensor.mvglive.markdown | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/_components/sensor.mvglive.markdown b/source/_components/sensor.mvglive.markdown index 21bf813bbd4e..2e13fd1f1716 100644 --- a/source/_components/sensor.mvglive.markdown +++ b/source/_components/sensor.mvglive.markdown @@ -30,15 +30,16 @@ Configuration variables: - **station** (*Required*): Name of the stop or station. Visit [the MVG live web site](http://www.mvg-live.de) to find valid names. - **destinations** (*Optional*): One or multiple final stop names, e.g. 'Feldmoching' or ['Feldmoching','Harthof']. This can be used to only consider a particular direction of travel + - **ubahndirection** (*Optional*): By default, direction is not filtered. Should only be used in connection with products: ['U-Bahn'] and can be set to 1 or 2. For U1, U2, U3 and U6, direction=1 indicates south-bound trains, direction=2 indicates northbound trains. For U4 and U5, direction=1 indicates east-bound trains, direction=2 indicates west-bound trains. For all other modes of transport, direction is equal to destination and can thus be filtered there. - **lines** (*Optional*): One or more line numbers, e.g. 'U2' or ['U2','U8','N41'] - **products** (*Optional*): One or more modes of transport, defaults to all 4 modes ['U-Bahn', 'Tram', 'Bus', 'S-Bahn']. - - **timeoffset** (*Optional*): Do not display connections departing sooner than this number of minutes (defaults to 0). Useful if you are a couple of minutes away from the stop. + - **timeoffset** (*Optional*): Do not display departures leaving sooner than this number of minutes (defaults to 0). Useful if you are a couple of minutes away from the stop. - **name** (*Optional*): You can customise the name of the sensor, which defaults to the station name. ## {% linkable_title Examples %} ### {% linkable_title Full configuration %} -The example below shows a full configuration with two sensors that showcase the various configuration options. +The example below shows a full configuration with three sensors that showcase the various configuration options. ```yaml # Example configuration.yml entry @@ -50,6 +51,10 @@ sensor: destinations: ['München Flughafen Terminal','Markt Schwaben'] products: 'S-Bahn' timeoffset: 2 - - station: Scheidplatz + - station: Sendlinger Tor lines: ['U2','U8'] + - station: Scheidplatz + products: ['U-Bahn'] + ubahndirection: 1 ``` +The first sensor will return S-Bahn departures to Munich Airport or Markt Schwaben that are at least 2 minutes away. The second sensor returns U2 and U8 departures from Sendlinger Tor while the third sensor returns all south-bound U-Bahn trains from Scheidplatz. From f8a815dc474a0b6a07622cd6d6c0ddddc87503c6 Mon Sep 17 00:00:00 2001 From: mountainsandcode Date: Thu, 6 Apr 2017 13:20:30 +0200 Subject: [PATCH 3/3] Updated to correspond to code PR --- source/_components/sensor.mvglive.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_components/sensor.mvglive.markdown b/source/_components/sensor.mvglive.markdown index 2e13fd1f1716..8d8dad582ae9 100644 --- a/source/_components/sensor.mvglive.markdown +++ b/source/_components/sensor.mvglive.markdown @@ -30,7 +30,7 @@ Configuration variables: - **station** (*Required*): Name of the stop or station. Visit [the MVG live web site](http://www.mvg-live.de) to find valid names. - **destinations** (*Optional*): One or multiple final stop names, e.g. 'Feldmoching' or ['Feldmoching','Harthof']. This can be used to only consider a particular direction of travel - - **ubahndirection** (*Optional*): By default, direction is not filtered. Should only be used in connection with products: ['U-Bahn'] and can be set to 1 or 2. For U1, U2, U3 and U6, direction=1 indicates south-bound trains, direction=2 indicates northbound trains. For U4 and U5, direction=1 indicates east-bound trains, direction=2 indicates west-bound trains. For all other modes of transport, direction is equal to destination and can thus be filtered there. + - **directions** (*Optional*): Filter by direction of the departure. For Tram, Bus, SEV, and S-Bahn, direction = direction. For U-Bahn trains, directions are more general. For U1, U2, U3 and U6, direction='1' indicates south-bound trains, direction='2' indicates northbound trains. For U4 and U5, direction='1' indicates east-bound trains, direction='2' indicates west-bound trains. For example, setting directions: '1' can be used to get all south-bound trains at Scheidplatz. - **lines** (*Optional*): One or more line numbers, e.g. 'U2' or ['U2','U8','N41'] - **products** (*Optional*): One or more modes of transport, defaults to all 4 modes ['U-Bahn', 'Tram', 'Bus', 'S-Bahn']. - **timeoffset** (*Optional*): Do not display departures leaving sooner than this number of minutes (defaults to 0). Useful if you are a couple of minutes away from the stop. @@ -55,6 +55,6 @@ sensor: lines: ['U2','U8'] - station: Scheidplatz products: ['U-Bahn'] - ubahndirection: 1 + directions: '1' ``` The first sensor will return S-Bahn departures to Munich Airport or Markt Schwaben that are at least 2 minutes away. The second sensor returns U2 and U8 departures from Sendlinger Tor while the third sensor returns all south-bound U-Bahn trains from Scheidplatz.