From 2f98adca49655d1dacf84849d66a9cfbae895806 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 6 Jun 2018 08:12:39 +0200 Subject: [PATCH] Fix OrFilter --- esphomeyaml/components/sensor/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphomeyaml/components/sensor/__init__.py b/esphomeyaml/components/sensor/__init__.py index deb55069cf..1dae6cc50c 100644 --- a/esphomeyaml/components/sensor/__init__.py +++ b/esphomeyaml/components/sensor/__init__.py @@ -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)