Fix OrFilter

This commit is contained in:
Otto Winter 2018-06-06 08:12:39 +02:00
parent 084fc00517
commit 2f98adca49
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -117,7 +117,10 @@ def setup_filter(config):
elif CONF_DELTA in config:
yield DeltaFilter.new(config[CONF_DELTA])
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:
yield App.register_component(HeartbeatFilter.new(config[CONF_HEARTBEAT]))
elif CONF_DEBOUNCE in config:
@ -131,7 +134,7 @@ def setup_filters(config):
for conf in config:
filter = None
for filter in setup_filter(conf):
yield
yield None
filters.append(filter)
yield ArrayInitializer(*filters)