1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 02:02:21 +01:00

Rewrite interrupt components (#464)

* Rewrite intterupt components

* Fix test
This commit is contained in:
Otto Winter
2019-03-03 16:47:10 +01:00
committed by GitHub
parent 4b017e2096
commit 5a102c2ab7
11 changed files with 57 additions and 19 deletions

View File

@@ -348,6 +348,14 @@ def shorthand_input_pullup_pin(value):
return {CONF_NUMBER: value}
def validate_has_interrupt(value):
if CORE.is_esp8266:
if value[CONF_NUMBER] >= 16:
raise vol.Invalid("Pins GPIO16 and GPIO17 do not support interrupts and cannot be used "
"here, got {}".format(value[CONF_NUMBER]))
return value
I2CDevice = esphome_ns.class_('I2CDevice')
PCF8574Component = io_ns.class_('PCF8574Component', Component, I2CDevice)