mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
fix pin range for xl9535 (#5722)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
parent
01d28ce3fc
commit
98ec798bfc
2 changed files with 16 additions and 1 deletions
|
@ -43,11 +43,17 @@ def validate_mode(mode):
|
|||
return mode
|
||||
|
||||
|
||||
def validate_pin(pin):
|
||||
if pin in (8, 9):
|
||||
raise cv.Invalid(f"pin {pin} doesn't exist")
|
||||
return pin
|
||||
|
||||
|
||||
XL9535_PIN_SCHEMA = cv.All(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(XL9535GPIOPin),
|
||||
cv.Required(CONF_XL9535): cv.use_id(XL9535Component),
|
||||
cv.Required(CONF_NUMBER): cv.int_range(min=0, max=15),
|
||||
cv.Required(CONF_NUMBER): cv.All(cv.int_range(min=0, max=17), validate_pin),
|
||||
cv.Optional(CONF_MODE, default={}): cv.All(
|
||||
{
|
||||
cv.Optional(CONF_INPUT, default=False): cv.boolean,
|
||||
|
|
|
@ -425,6 +425,15 @@ binary_sensor:
|
|||
input: true
|
||||
inverted: false
|
||||
|
||||
- platform: gpio
|
||||
name: XL9535 Pin 17
|
||||
pin:
|
||||
xl9535: xl9535_hub
|
||||
number: 17
|
||||
mode:
|
||||
input: true
|
||||
inverted: false
|
||||
|
||||
climate:
|
||||
- platform: tuya
|
||||
id: tuya_climate
|
||||
|
|
Loading…
Reference in a new issue