Skip to content

Commit f2dba1f

Browse files
committed
add documentation for "shared_gpio" flag to component switch.rpi_gpio
1 parent d5404ed commit f2dba1f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/_components/switch.rpi_gpio.markdown

+11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Configuration variables:
3232
- **ports** array (*Required*): Array of used ports.
3333
- **port: name** (*Required*): Port numbers and corresponding names (GPIO #).
3434
- **invert_logic** (*Optional*): If true, inverts the output logic to ACTIVE LOW. Default is false (ACTIVE HIGH).
35+
- **shared_gpio** (*Optional*): If true, forces a GPIO.setup() before each write. Default is false.
3536
3637
For more details about the GPIO layout, visit the Wikipedia [article](https://en.wikipedia.org/wiki/Raspberry_Pi#GPIO_connector) about the Raspberry Pi.
3738
@@ -46,4 +47,14 @@ switch:
4647
17: Speaker Relay
4748
```
4849
50+
In case you have any other python scripts running that use RPi.GPIO no values will be written after the initial HASS-start.
51+
Setting **shared_gpio** to true will reinit the pin before each write, working around this issue.
52+
```yaml
53+
# Example configuration.yaml entry
54+
switch:
55+
- platform: rpi_gpio
56+
shared_gpio: true
57+
ports:
58+
19: LED-Red
59+
```
4960

0 commit comments

Comments
 (0)