Migration Arduino to new config style (#3919)

This commit is contained in:
Fabian Affolter 2017-11-07 09:49:28 +01:00 committed by GitHub
parent 9afaa05223
commit 3365e091f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 16 deletions

View File

@ -30,9 +30,12 @@ arduino:
port: /dev/ttyACM0
```
Configuration variables:
- **port** (*Required*): The port where your board is connected to your Home Assistant host. If you are using an original Arduino, the port will be named `ttyACM*` otherwise `ttyUSB*`.
{% configuration %}
port:
description: The port where your board is connected to your Home Assistant host. If you are using an original Arduino, the port will be named `ttyACM*` otherwise `ttyUSB*`.
required: true
type: string
{% endconfiguration %}
The exact number can be determined with the command shown below.

View File

@ -27,14 +27,23 @@ sensor:
name: Door switch
0:
name: Brightness
```
Configuration variables:
- **pins** array (*Required*): Array of pins to use.
- **[number]** (*Required*): The pin number that corresponds with the pin numbering schema of your board.
- **name** (*Optional*): Name that will be used in the frontend for the pin.
{% configuration %}
pins:
description: List of pins to use.
required: true
type: map
keys:
pin_number:
description: The pin number that corresponds with the pin numbering schema of your board.
required: true
type: map
keys:
name:
default: Name that will be used in the frontend for the pin.
type: string
{% endconfiguration %}
The 6 analog pins of an Arduino UNO are numbered from A0 to A5.

View File

@ -31,13 +31,32 @@ switch:
negate: true
```
Configuration variables:
- **pins** array (*Required*): List of pins to use.
- **[number]** (*Required*): The pin number that corresponds with the pin numbering schema of your board.
- **name** (*Required*): Name that will be used in the frontend for the pin.
- **initial** (*Optional*): The initial value for this port. Defaults to `False` .
- **negate** (*Optional*): If this pin should be inverted. Defaults to `False`.
{% configuration %}
pins:
description: List of of pins to use.
required: true
type: map
keys:
pin_number:
description: The pin number that corresponds with the pin numbering schema of your board.
required: true
type: map
keys:
name:
default: Name that will be used in the frontend for the pin.
type: string
required: false
initial:
default: The initial value for this port.
type: boolean
required: false
default: false
negate:
default: If this pin should be inverted.
type: boolean
required: false
default: false
{% endconfiguration %}
The digital pins are numbered from 0 to 13 on a Arduino UNO. The available pins are 2 till 13. For testing purposes you can use pin 13 because with that pin you can control the internal LED.