From 44f2b582b56958022af5dbd8c2012ec66ad98a35 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 14 May 2018 17:34:43 +0200 Subject: [PATCH] FastLED fixes --- esphomeyaml/components/ir_transmitter.py | 2 +- esphomeyaml/components/light/fastled_clockless.py | 13 ++----------- esphomeyaml/config_validation.py | 1 + esphomeyaml/pins.py | 2 -- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/esphomeyaml/components/ir_transmitter.py b/esphomeyaml/components/ir_transmitter.py index 9768795807..c6595636ba 100644 --- a/esphomeyaml/components/ir_transmitter.py +++ b/esphomeyaml/components/ir_transmitter.py @@ -11,7 +11,7 @@ CONFIG_SCHEMA = vol.All(cv.ensure_list, [vol.Schema({ cv.GenerateID('ir_transmitter'): cv.register_variable_id, vol.Required(CONF_PIN): pins.GPIO_OUTPUT_PIN_SCHEMA, vol.Optional(CONF_CARRIER_DUTY_PERCENT): vol.All(vol.Coerce(int), - vol.Range(min=0, max=100, min_included=False)), + vol.Range(min=1, max=100)), })]) diff --git a/esphomeyaml/components/light/fastled_clockless.py b/esphomeyaml/components/light/fastled_clockless.py index c6a5d3ad1f..cfda82aef5 100644 --- a/esphomeyaml/components/light/fastled_clockless.py +++ b/esphomeyaml/components/light/fastled_clockless.py @@ -6,8 +6,8 @@ from esphomeyaml.components import light from esphomeyaml.const import CONF_CHIPSET, CONF_DEFAULT_TRANSITION_LENGTH, CONF_GAMMA_CORRECT, \ CONF_ID, CONF_MAX_REFRESH_RATE, CONF_NAME, CONF_NUM_LEDS, CONF_PIN, CONF_RGB_ORDER, \ ESP_PLATFORM_ESP32 -from esphomeyaml.helpers import App, TemplateArguments, add, setup_mqtt_component, variable, \ - RawExpression +from esphomeyaml.helpers import App, RawExpression, TemplateArguments, add, setup_mqtt_component, \ + variable TYPES = [ 'NEOPIXEL', @@ -34,7 +34,6 @@ TYPES = [ 'GW6205_400', 'LPD1886', 'LPD1886_8BIT', - 'PIXIE', ] RGB_ORDERS = [ @@ -50,8 +49,6 @@ RGB_ORDERS = [ def validate(value): if value[CONF_CHIPSET] == 'NEOPIXEL' and CONF_RGB_ORDER in value: raise vol.Invalid("NEOPIXEL doesn't support RGB order") - if value[CONF_CHIPSET] == 'PIXIE' and core.ESP_PLATFORM == ESP_PLATFORM_ESP32: - raise vol.Invalid("PIXIE lights are not supported with the ESP32") return value @@ -90,9 +87,3 @@ def to_code(config): BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT' - - -def required_build_flags(config): - if config[CONF_CHIPSET] == 'PIXIE': - return '-DUSE_FAST_LED_LIGHT_PIXIE' - return None diff --git a/esphomeyaml/config_validation.py b/esphomeyaml/config_validation.py index af39a4738d..5d8b3bfa11 100644 --- a/esphomeyaml/config_validation.py +++ b/esphomeyaml/config_validation.py @@ -312,6 +312,7 @@ METRIC_SUFFIXES = { def frequency(value): + value = string(value) match = re.match(r"^([-+]?[0-9]*\.?[0-9]*)\s*(\w*?)(?:Hz|HZ|hz)?$", value) if match is None: diff --git a/esphomeyaml/pins.py b/esphomeyaml/pins.py index b32a615aa9..9ce8b1abb5 100644 --- a/esphomeyaml/pins.py +++ b/esphomeyaml/pins.py @@ -135,8 +135,6 @@ def output_pin(value): u"input pins.".format(value)) return value elif core.ESP_PLATFORM == ESP_PLATFORM_ESP8266: - if value == 16: - raise vol.Invalid(u"Pin {} doesn't support output mode".format(value)) return value raise vol.Invalid("Invalid ESP platform.")