From 1f6b340da98b9826db692401a153778eab3a2a75 Mon Sep 17 00:00:00 2001 From: w1ll1am23 Date: Tue, 15 May 2018 19:39:33 -0400 Subject: [PATCH 1/4] Updated aREST switch doc for invert --- source/_components/switch.arest.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_components/switch.arest.markdown b/source/_components/switch.arest.markdown index 603949d5c130..8fded77102be 100644 --- a/source/_components/switch.arest.markdown +++ b/source/_components/switch.arest.markdown @@ -46,6 +46,7 @@ Configuration variables: - **name** (*Optional*): Let you overwrite the name of the device. By default *name* from the device is used. - **pins** array (*Optional*): An array with all used pins. - **name** (*Required*): The name of the pin to use in the frontend. + - **invert** (*Optional*): If the logic for on/off should be inverted. 1 = off and 0 = on or From e653b4c7800aed6fab182cc07509602ac1dfb1e9 Mon Sep 17 00:00:00 2001 From: w1ll1am23 Date: Thu, 17 May 2018 20:57:41 -0400 Subject: [PATCH 2/4] Updated to configuration block --- source/_components/switch.arest.markdown | 49 +++++++++++++++++------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/source/_components/switch.arest.markdown b/source/_components/switch.arest.markdown index 8fded77102be..17c8f3758138 100644 --- a/source/_components/switch.arest.markdown +++ b/source/_components/switch.arest.markdown @@ -25,6 +25,9 @@ switch: pins: 11: name: Fan + 13: + name: Switch + invert: True ``` If you want to use custom functions, then add the following to your `configuration.yaml` file: @@ -39,19 +42,39 @@ switch: function1: name: Light Desk ``` - -Configuration variables: - -- **resource** (*Required*): IP address and schema of the device that is exposing an aREST API, eg. http://192.168.1.10 (no-trailing slash) -- **name** (*Optional*): Let you overwrite the name of the device. By default *name* from the device is used. -- **pins** array (*Optional*): An array with all used pins. - - **name** (*Required*): The name of the pin to use in the frontend. - - **invert** (*Optional*): If the logic for on/off should be inverted. 1 = off and 0 = on - -or - -- **functions** array (*Optional*): An array with all used functions. - - **name** (*Required*): The name to use in the frontend. +{% configuration %} +resource: + description: IP address and schema of the device that is exposing an aREST API, eg. http://192.168.1.10 (no-trailing slash) + required: true + type: string +name: + description: Let you overwrite the name of the device. By default *name* from the device is used. + required: optional + type: string +pins: + description: An array with all used pins. + required: optional + type: map + keys: + name: + description: The name of the pin to use in the frontend. + required: true + type: string + invert: + description: If the logic for on/off should be inverted. + required: optional + type: boolean + default: false +functions: + description: An array with all used functions. + required: optional + type: map + keys: + name: + description: The name to use in the frontend. + required: true + type: string +{% endconfiguration %} You can still switch your pins with a web browser or a command line tool. Use the URL http://192.168.1.10/digital/8/1 to set pin 8 to high/on, the JSON response will give you the feedback. From 26b4b605d0a0550403f8cc47b61e2924383e127f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 18 May 2018 10:33:31 +0200 Subject: [PATCH 3/4] :pencil2: Changed values of required configuration keys --- source/_components/switch.arest.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_components/switch.arest.markdown b/source/_components/switch.arest.markdown index 17c8f3758138..322fd04a3e8e 100644 --- a/source/_components/switch.arest.markdown +++ b/source/_components/switch.arest.markdown @@ -53,7 +53,7 @@ name: type: string pins: description: An array with all used pins. - required: optional + required: false type: map keys: name: @@ -62,12 +62,12 @@ pins: type: string invert: description: If the logic for on/off should be inverted. - required: optional + required: false type: boolean default: false functions: description: An array with all used functions. - required: optional + required: false type: map keys: name: From 4747b1362326a2c44c5be9d39f0823b17e89f1be Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 18 May 2018 12:25:00 +0200 Subject: [PATCH 4/4] :pencil2: Language tweak --- source/_components/switch.arest.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_components/switch.arest.markdown b/source/_components/switch.arest.markdown index 322fd04a3e8e..e0b63695371c 100644 --- a/source/_components/switch.arest.markdown +++ b/source/_components/switch.arest.markdown @@ -13,7 +13,7 @@ ha_iot_class: "Local Polling" ha_release: 0.16 --- -The `arest` switch platform allows you to toggle pins of your devices (like Arduino boards with a Ethernet/Wifi connection, ESP8266 based devices, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework. +The `arest` switch platform allows you to toggle pins of your devices (like Arduino boards with an Ethernet/Wifi connection, ESP8266 based devices, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework. To use your aREST enabled device with pins in your installation, add the following to your `configuration.yaml` file: @@ -44,7 +44,7 @@ switch: ``` {% configuration %} resource: - description: IP address and schema of the device that is exposing an aREST API, eg. http://192.168.1.10 (no-trailing slash) + description: IP address and schema of the device that is exposing an aREST API, e.g., http://192.168.1.10 (no-trailing slash) required: true type: string name: