[gpio][binary_sensor] Fix pin validation for external GPIO pins (#16528)
This commit is contained in:
1 parent
5732d7135f
commit
f41866a9b8
1 file changed
+2
-2
@@ -74,8 +74,6 @@ def _final_validate(config):
|
|||||||
if not use_interrupt:
|
if not use_interrupt:
|
||||||
return config
|
return config
|
||||||
|
|
||||||
pin_num = config[CONF_PIN][CONF_NUMBER]
|
|
||||||
|
|
||||||
# Expander pins (e.g. PCF8574, MCP23017) don't support direct interrupt
|
# Expander pins (e.g. PCF8574, MCP23017) don't support direct interrupt
|
||||||
# attachment — only internal/native GPIO pins do.
|
# attachment — only internal/native GPIO pins do.
|
||||||
if pins.PIN_SCHEMA_REGISTRY.get_key(config[CONF_PIN]) != CORE.target_platform:
|
if pins.PIN_SCHEMA_REGISTRY.get_key(config[CONF_PIN]) != CORE.target_platform:
|
||||||
@@ -87,6 +85,8 @@ def _final_validate(config):
|
|||||||
config[CONF_USE_INTERRUPT] = False
|
config[CONF_USE_INTERRUPT] = False
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
pin_num = config[CONF_PIN][CONF_NUMBER]
|
||||||
|
|
||||||
# GPIO16 on ESP8266 doesn't support interrupts through attachInterrupt().
|
# GPIO16 on ESP8266 doesn't support interrupts through attachInterrupt().
|
||||||
if CORE.is_esp8266 and pin_num == 16:
|
if CORE.is_esp8266 and pin_num == 16:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
|
|||||||
Reference in new issue
Block a user