From 9a1ec53d0ba1ec3c3cf6429b90bfd968d7424641 Mon Sep 17 00:00:00 2001 From: Kenneth Lavrsen Date: Tue, 27 Aug 2019 13:07:27 +0200 Subject: [PATCH 1/5] Document 'name' config parameter in rejseplanen Document the undocumented but fully working name config. This is an optional config but essential to know to define more than one instance of the rejseplanen sensor and getting a predictable result. Otherwise the sensor name defaults to sensor.next_departure_# and the numbers can swap around after an HA restart --- source/_components/rejseplanen.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/_components/rejseplanen.markdown b/source/_components/rejseplanen.markdown index 03bee9fefbc8..b26a0a98b351 100644 --- a/source/_components/rejseplanen.markdown +++ b/source/_components/rejseplanen.markdown @@ -45,6 +45,7 @@ Add a sensor to your `configuration.yaml` file as shown in the example: # Example configuration.yaml entry sensor: - platform: rejseplanen + name: 'Bus Stop Name' stop_id: 'YOUR_STOP_ID' ``` @@ -53,6 +54,11 @@ stop_id: description: The ID of the public transport stop. required: true type: string +name: + description: The name of the sensor. Entity ID for the sensor will be created based on this name. Example - Glostrup St becomes sensor.glostrup_st. It is optional but recommended if you define more than one sensor + required: false + type: string + default: next_departure route: description: List of route names. required: false @@ -105,6 +111,7 @@ A more extensive example on how to use this sensor: # Example configuration.yaml entry sensor: - platform: rejseplanen + name:'Elmegade 350S' stop_id: '000045740' route: 'Bus 350S' direction: From bf1ae84fc644b9bb7a5721ce1a8e1062f73145c2 Mon Sep 17 00:00:00 2001 From: Kenneth Lavrsen Date: Tue, 27 Aug 2019 14:10:36 +0200 Subject: [PATCH 2/5] An example where policy and common sense clash Done as suggested though I do not agree --- source/_components/rejseplanen.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/source/_components/rejseplanen.markdown b/source/_components/rejseplanen.markdown index b26a0a98b351..3a7d76f4c77c 100644 --- a/source/_components/rejseplanen.markdown +++ b/source/_components/rejseplanen.markdown @@ -45,7 +45,6 @@ Add a sensor to your `configuration.yaml` file as shown in the example: # Example configuration.yaml entry sensor: - platform: rejseplanen - name: 'Bus Stop Name' stop_id: 'YOUR_STOP_ID' ``` From c67838209e755d22f6c923701e5affa12b7f9cfc Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Tue, 27 Aug 2019 14:32:59 +0200 Subject: [PATCH 3/5] :pencil2: Tweak --- source/_components/rejseplanen.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/rejseplanen.markdown b/source/_components/rejseplanen.markdown index 3a7d76f4c77c..6b25a7cffe2d 100644 --- a/source/_components/rejseplanen.markdown +++ b/source/_components/rejseplanen.markdown @@ -54,7 +54,7 @@ stop_id: required: true type: string name: - description: The name of the sensor. Entity ID for the sensor will be created based on this name. Example - Glostrup St becomes sensor.glostrup_st. It is optional but recommended if you define more than one sensor + description: The name of the sensor. Entity ID for the sensor will be created based on this name. Example - Glostrup St becomes sensor.glostrup_st. It's optional but recommended if you define more than one sensor. required: false type: string default: next_departure From 7d899a01de500de0201349b28826303571cd2e5d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 27 Aug 2019 18:39:58 +0200 Subject: [PATCH 4/5] Adjust default --- source/_components/rejseplanen.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_components/rejseplanen.markdown b/source/_components/rejseplanen.markdown index 6b25a7cffe2d..7bc453fd542c 100644 --- a/source/_components/rejseplanen.markdown +++ b/source/_components/rejseplanen.markdown @@ -54,10 +54,10 @@ stop_id: required: true type: string name: - description: The name of the sensor. Entity ID for the sensor will be created based on this name. Example - Glostrup St becomes sensor.glostrup_st. It's optional but recommended if you define more than one sensor. + description: "The name of the sensor. Entity ID for the sensor will be created based on this name. E.g., Glostrup St becomes `sensor.glostrup_st`. It's optional but recommended if you define more than one sensor." required: false type: string - default: next_departure + default: "Next departure" route: description: List of route names. required: false From 3de44eb4247fd2e4142d0e93c99694004400dbb6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 27 Aug 2019 18:40:29 +0200 Subject: [PATCH 5/5] Fix sample --- source/_components/rejseplanen.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/rejseplanen.markdown b/source/_components/rejseplanen.markdown index 7bc453fd542c..c152d4e98843 100644 --- a/source/_components/rejseplanen.markdown +++ b/source/_components/rejseplanen.markdown @@ -110,7 +110,7 @@ A more extensive example on how to use this sensor: # Example configuration.yaml entry sensor: - platform: rejseplanen - name:'Elmegade 350S' + name: 'Elmegade 350S' stop_id: '000045740' route: 'Bus 350S' direction: