mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
FastLED fixes
This commit is contained in:
parent
262855ff62
commit
44f2b582b5
4 changed files with 4 additions and 14 deletions
|
@ -11,7 +11,7 @@ CONFIG_SCHEMA = vol.All(cv.ensure_list, [vol.Schema({
|
||||||
cv.GenerateID('ir_transmitter'): cv.register_variable_id,
|
cv.GenerateID('ir_transmitter'): cv.register_variable_id,
|
||||||
vol.Required(CONF_PIN): pins.GPIO_OUTPUT_PIN_SCHEMA,
|
vol.Required(CONF_PIN): pins.GPIO_OUTPUT_PIN_SCHEMA,
|
||||||
vol.Optional(CONF_CARRIER_DUTY_PERCENT): vol.All(vol.Coerce(int),
|
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)),
|
||||||
})])
|
})])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ from esphomeyaml.components import light
|
||||||
from esphomeyaml.const import CONF_CHIPSET, CONF_DEFAULT_TRANSITION_LENGTH, CONF_GAMMA_CORRECT, \
|
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, \
|
CONF_ID, CONF_MAX_REFRESH_RATE, CONF_NAME, CONF_NUM_LEDS, CONF_PIN, CONF_RGB_ORDER, \
|
||||||
ESP_PLATFORM_ESP32
|
ESP_PLATFORM_ESP32
|
||||||
from esphomeyaml.helpers import App, TemplateArguments, add, setup_mqtt_component, variable, \
|
from esphomeyaml.helpers import App, RawExpression, TemplateArguments, add, setup_mqtt_component, \
|
||||||
RawExpression
|
variable
|
||||||
|
|
||||||
TYPES = [
|
TYPES = [
|
||||||
'NEOPIXEL',
|
'NEOPIXEL',
|
||||||
|
@ -34,7 +34,6 @@ TYPES = [
|
||||||
'GW6205_400',
|
'GW6205_400',
|
||||||
'LPD1886',
|
'LPD1886',
|
||||||
'LPD1886_8BIT',
|
'LPD1886_8BIT',
|
||||||
'PIXIE',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
RGB_ORDERS = [
|
RGB_ORDERS = [
|
||||||
|
@ -50,8 +49,6 @@ RGB_ORDERS = [
|
||||||
def validate(value):
|
def validate(value):
|
||||||
if value[CONF_CHIPSET] == 'NEOPIXEL' and CONF_RGB_ORDER in value:
|
if value[CONF_CHIPSET] == 'NEOPIXEL' and CONF_RGB_ORDER in value:
|
||||||
raise vol.Invalid("NEOPIXEL doesn't support RGB order")
|
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
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,9 +87,3 @@ def to_code(config):
|
||||||
|
|
||||||
|
|
||||||
BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT'
|
BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT'
|
||||||
|
|
||||||
|
|
||||||
def required_build_flags(config):
|
|
||||||
if config[CONF_CHIPSET] == 'PIXIE':
|
|
||||||
return '-DUSE_FAST_LED_LIGHT_PIXIE'
|
|
||||||
return None
|
|
||||||
|
|
|
@ -312,6 +312,7 @@ METRIC_SUFFIXES = {
|
||||||
|
|
||||||
|
|
||||||
def frequency(value):
|
def frequency(value):
|
||||||
|
value = string(value)
|
||||||
match = re.match(r"^([-+]?[0-9]*\.?[0-9]*)\s*(\w*?)(?:Hz|HZ|hz)?$", value)
|
match = re.match(r"^([-+]?[0-9]*\.?[0-9]*)\s*(\w*?)(?:Hz|HZ|hz)?$", value)
|
||||||
|
|
||||||
if match is None:
|
if match is None:
|
||||||
|
|
|
@ -135,8 +135,6 @@ def output_pin(value):
|
||||||
u"input pins.".format(value))
|
u"input pins.".format(value))
|
||||||
return value
|
return value
|
||||||
elif core.ESP_PLATFORM == ESP_PLATFORM_ESP8266:
|
elif core.ESP_PLATFORM == ESP_PLATFORM_ESP8266:
|
||||||
if value == 16:
|
|
||||||
raise vol.Invalid(u"Pin {} doesn't support output mode".format(value))
|
|
||||||
return value
|
return value
|
||||||
raise vol.Invalid("Invalid ESP platform.")
|
raise vol.Invalid("Invalid ESP platform.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue