mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
parent
92e909568c
commit
7b26ecc0dc
3 changed files with 2 additions and 6 deletions
|
@ -60,8 +60,9 @@ FILTERS_SCHEMA = cv.ensure_list({
|
|||
vol.Optional(CONF_INVERT): None,
|
||||
vol.Optional(CONF_DELAYED_ON): cv.positive_time_period_milliseconds,
|
||||
vol.Optional(CONF_DELAYED_OFF): cv.positive_time_period_milliseconds,
|
||||
vol.Optional(CONF_HEARTBEAT): cv.positive_time_period_milliseconds,
|
||||
vol.Optional(CONF_LAMBDA): cv.lambda_,
|
||||
|
||||
vol.Optional(CONF_HEARTBEAT): cv.invalid("The heartbeat filter has been removed in 1.11.0"),
|
||||
}, cv.has_exactly_one_key(*FILTER_KEYS))
|
||||
|
||||
MULTI_CLICK_TIMING_SCHEMA = vol.Schema({
|
||||
|
@ -205,8 +206,6 @@ def setup_filter(config):
|
|||
yield App.register_component(DelayedOffFilter.new(config[CONF_DELAYED_OFF]))
|
||||
elif CONF_DELAYED_ON in config:
|
||||
yield App.register_component(DelayedOnFilter.new(config[CONF_DELAYED_ON]))
|
||||
elif CONF_HEARTBEAT in config:
|
||||
yield App.register_component(HeartbeatFilter.new(config[CONF_HEARTBEAT]))
|
||||
elif CONF_LAMBDA in config:
|
||||
for lambda_ in process_lambda(config[CONF_LAMBDA], [(bool_, 'x')],
|
||||
return_type=optional.template(bool_)):
|
||||
|
|
|
@ -161,7 +161,6 @@ def setup_filter(config):
|
|||
def setup_filters(config):
|
||||
filters = []
|
||||
for conf in config:
|
||||
filter = None
|
||||
for filter in setup_filter(conf):
|
||||
yield None
|
||||
filters.append(filter)
|
||||
|
@ -178,7 +177,6 @@ def setup_sensor_core_(sensor_var, mqtt_var, config):
|
|||
if CONF_ACCURACY_DECIMALS in config:
|
||||
add(sensor_var.set_accuracy_decimals(config[CONF_ACCURACY_DECIMALS]))
|
||||
if CONF_FILTERS in config:
|
||||
filters = None
|
||||
for filters in setup_filters(config[CONF_FILTERS]):
|
||||
yield
|
||||
add(sensor_var.set_filters(filters))
|
||||
|
|
|
@ -481,7 +481,6 @@ binary_sensor:
|
|||
- invert:
|
||||
- delayed_on: 40ms
|
||||
- delayed_off: 40ms
|
||||
- heartbeat: 1s
|
||||
on_press:
|
||||
then:
|
||||
- lambda: >-
|
||||
|
|
Loading…
Reference in a new issue