vol.Schema -> cv.Schema

This commit is contained in:
Otto Winter 2019-03-05 15:06:38 +01:00
parent a99f99779a
commit 289acade1e
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E
4 changed files with 5 additions and 5 deletions

View file

@ -131,7 +131,7 @@ def homeassistant_service_to_code(config, action_id, template_arg, args):
CONF_API_CONNECTED = 'api.connected' CONF_API_CONNECTED = 'api.connected'
API_CONNECTED_CONDITION_SCHEMA = vol.Schema({}) API_CONNECTED_CONDITION_SCHEMA = cv.Schema({})
@CONDITION_REGISTRY.register(CONF_API_CONNECTED, API_CONNECTED_CONDITION_SCHEMA) @CONDITION_REGISTRY.register(CONF_API_CONNECTED, API_CONNECTED_CONDITION_SCHEMA)

View file

@ -350,7 +350,7 @@ LIB_DEPS = 'AsyncMqttClient@0.8.2'
BUILD_FLAGS = '-DUSE_MQTT' BUILD_FLAGS = '-DUSE_MQTT'
CONF_MQTT_CONNECTED = 'mqtt.connected' CONF_MQTT_CONNECTED = 'mqtt.connected'
MQTT_CONNECTED_CONDITION_SCHEMA = vol.Schema({}) MQTT_CONNECTED_CONDITION_SCHEMA = cv.Schema({})
@CONDITION_REGISTRY.register(CONF_MQTT_CONNECTED, MQTT_CONNECTED_CONDITION_SCHEMA) @CONDITION_REGISTRY.register(CONF_MQTT_CONNECTED, MQTT_CONNECTED_CONDITION_SCHEMA)

View file

@ -46,7 +46,7 @@ FILTER_KEYS = [CONF_OFFSET, CONF_MULTIPLY, CONF_FILTER_OUT,
def validate_datapoint(value): def validate_datapoint(value):
if isinstance(value, dict): if isinstance(value, dict):
return vol.Schema({ return cv.Schema({
vol.Required(CONF_FROM): cv.float_, vol.Required(CONF_FROM): cv.float_,
vol.Required(CONF_TO): cv.float_, vol.Required(CONF_TO): cv.float_,
})(value) })(value)
@ -67,7 +67,7 @@ FILTERS_SCHEMA = cv.ensure_list({
vol.Optional(CONF_FILTER_OUT): cv.float_, vol.Optional(CONF_FILTER_OUT): cv.float_,
vol.Optional('filter_nan'): cv.invalid("The filter_nan filter has been removed. Please use " vol.Optional('filter_nan'): cv.invalid("The filter_nan filter has been removed. Please use "
"'filter_out: nan' instead"), "'filter_out: nan' instead"),
vol.Optional(CONF_SLIDING_WINDOW_MOVING_AVERAGE): vol.All(vol.Schema({ vol.Optional(CONF_SLIDING_WINDOW_MOVING_AVERAGE): vol.All(cv.Schema({
vol.Optional(CONF_WINDOW_SIZE, default=15): cv.positive_not_null_int, vol.Optional(CONF_WINDOW_SIZE, default=15): cv.positive_not_null_int,
vol.Optional(CONF_SEND_EVERY, default=15): cv.positive_not_null_int, vol.Optional(CONF_SEND_EVERY, default=15): cv.positive_not_null_int,
vol.Optional(CONF_SEND_FIRST_AT): cv.positive_not_null_int, vol.Optional(CONF_SEND_FIRST_AT): cv.positive_not_null_int,

View file

@ -193,7 +193,7 @@ def lib_deps(config):
CONF_WIFI_CONNECTED = 'wifi.connected' CONF_WIFI_CONNECTED = 'wifi.connected'
WIFI_CONNECTED_CONDITION_SCHEMA = vol.Schema({}) WIFI_CONNECTED_CONDITION_SCHEMA = cv.Schema({})
@CONDITION_REGISTRY.register(CONF_WIFI_CONNECTED, WIFI_CONNECTED_CONDITION_SCHEMA) @CONDITION_REGISTRY.register(CONF_WIFI_CONNECTED, WIFI_CONNECTED_CONDITION_SCHEMA)