adds gpio INPUT_OUTPUT_OPEN_DRAIN (#4360)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
tomaszduda23 2023-02-07 00:55:35 +01:00 committed by GitHub
parent d3627f0972
commit 393ca64d70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -49,6 +49,11 @@ def _set_mode(value, default_mode):
CONF_INPUT: True, CONF_INPUT: True,
CONF_PULLDOWN: True, CONF_PULLDOWN: True,
}, },
"INPUT_OUTPUT_OPEN_DRAIN": {
CONF_INPUT: True,
CONF_OUTPUT: True,
CONF_OPEN_DRAIN: True,
},
} }
if mode.upper() not in PIN_MODES: if mode.upper() not in PIN_MODES:
raise cv.Invalid(f"Unknown pin mode {mode}", [CONF_MODE]) raise cv.Invalid(f"Unknown pin mode {mode}", [CONF_MODE])

View file

@ -1321,6 +1321,11 @@ binary_sensor:
number: GPIO9 number: GPIO9
mode: INPUT_PULLUP mode: INPUT_PULLUP
name: Living Room Window 2 name: Living Room Window 2
- platform: gpio
pin:
number: GPIO9
mode: INPUT_OUTPUT_OPEN_DRAIN
name: Living Room Button
- platform: status - platform: status
name: Living Room Status name: Living Room Status
- platform: esp32_touch - platform: esp32_touch