mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 11:37:27 +01:00
Fix OrFilter
This commit is contained in:
parent
084fc00517
commit
2f98adca49
@ -117,7 +117,10 @@ def setup_filter(config):
|
|||||||
elif CONF_DELTA in config:
|
elif CONF_DELTA in config:
|
||||||
yield DeltaFilter.new(config[CONF_DELTA])
|
yield DeltaFilter.new(config[CONF_DELTA])
|
||||||
elif CONF_OR in config:
|
elif CONF_OR in config:
|
||||||
yield OrFilter.new(setup_filters(config[CONF_OR]))
|
filters = None
|
||||||
|
for filters in setup_filters(config[CONF_OR]):
|
||||||
|
yield None
|
||||||
|
yield OrFilter.new(filters)
|
||||||
elif CONF_HEARTBEAT in config:
|
elif CONF_HEARTBEAT in config:
|
||||||
yield App.register_component(HeartbeatFilter.new(config[CONF_HEARTBEAT]))
|
yield App.register_component(HeartbeatFilter.new(config[CONF_HEARTBEAT]))
|
||||||
elif CONF_DEBOUNCE in config:
|
elif CONF_DEBOUNCE in config:
|
||||||
@ -131,7 +134,7 @@ def setup_filters(config):
|
|||||||
for conf in config:
|
for conf in config:
|
||||||
filter = None
|
filter = None
|
||||||
for filter in setup_filter(conf):
|
for filter in setup_filter(conf):
|
||||||
yield
|
yield None
|
||||||
filters.append(filter)
|
filters.append(filter)
|
||||||
yield ArrayInitializer(*filters)
|
yield ArrayInitializer(*filters)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user