Small fixes

This commit is contained in:
Otto Winter 2018-06-14 00:14:01 +02:00
parent b13cc3a4a5
commit 12c4b0788c
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E
3 changed files with 21 additions and 25 deletions

View file

@ -76,10 +76,10 @@ build:armhf:
variables: variables:
ADDON_ARCH: armhf ADDON_ARCH: armhf
build:aarch64: #build:aarch64:
<<: *build # <<: *build
variables: # variables:
ADDON_ARCH: aarch64 # ADDON_ARCH: aarch64
build:i386: build:i386:
<<: *build <<: *build
@ -101,14 +101,14 @@ deploy:armhf:
except: except:
- /^(?!master).+@/ - /^(?!master).+@/
deploy:aarch64: #deploy:aarch64:
<<: *deploy # <<: *deploy
variables: # variables:
ADDON_ARCH: aarch64 # ADDON_ARCH: aarch64
only: # only:
- /^v\d+\.\d+\.\d+(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?$/ # - /^v\d+\.\d+\.\d+(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?$/
except: # except:
- /^(?!master).+@/ # - /^(?!master).+@/
deploy:i386: deploy:i386:
<<: *deploy <<: *deploy

View file

@ -3,9 +3,9 @@ import voluptuous as vol
import esphomeyaml.config_validation as cv import esphomeyaml.config_validation as cv
from esphomeyaml.components import binary_sensor from esphomeyaml.components import binary_sensor
from esphomeyaml.components.remote_receiver import RemoteReceiverComponent, remote_ns from esphomeyaml.components.remote_receiver import RemoteReceiverComponent, remote_ns
from esphomeyaml.const import CONF_ADDRESS, CONF_CARRIER_FREQUENCY, CONF_COMMAND, CONF_DATA, \ from esphomeyaml.const import CONF_ADDRESS, CONF_COMMAND, CONF_DATA, \
CONF_LG, CONF_NAME, CONF_NBITS, CONF_NEC, CONF_PANASONIC, CONF_RAW, CONF_SONY CONF_LG, CONF_NAME, CONF_NBITS, CONF_NEC, CONF_PANASONIC, CONF_RAW, CONF_SONY
from esphomeyaml.helpers import App, ArrayInitializer, Pvariable, get_variable from esphomeyaml.helpers import ArrayInitializer, Pvariable, get_variable
DEPENDENCIES = ['remote_receiver'] DEPENDENCIES = ['remote_receiver']
@ -38,10 +38,7 @@ PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend
vol.Required(CONF_ADDRESS): cv.hex_uint16_t, vol.Required(CONF_ADDRESS): cv.hex_uint16_t,
vol.Required(CONF_COMMAND): cv.hex_uint32_t, vol.Required(CONF_COMMAND): cv.hex_uint32_t,
}), }),
vol.Optional(CONF_RAW): vol.Schema({ vol.Optional(CONF_RAW): [vol.Any(vol.Coerce(int), cv.time_period_microseconds)],
vol.Required(CONF_DATA): [vol.Any(vol.Coerce(int), cv.time_period_microseconds)],
vol.Optional(CONF_CARRIER_FREQUENCY): vol.All(cv.frequency, vol.Coerce(int)),
}),
cv.GenerateID(CONF_REMOTE_RECEIVER_ID): cv.use_variable_id(RemoteReceiverComponent), cv.GenerateID(CONF_REMOTE_RECEIVER_ID): cv.use_variable_id(RemoteReceiverComponent),
cv.GenerateID(CONF_RECEIVER_ID): cv.declare_variable_id(RemoteReceiver), cv.GenerateID(CONF_RECEIVER_ID): cv.declare_variable_id(RemoteReceiver),
}), cv.has_exactly_one_key(*IR_KEYS)) }), cv.has_exactly_one_key(*IR_KEYS))
@ -61,9 +58,8 @@ def receiver_base(config):
conf = config[CONF_SONY] conf = config[CONF_SONY]
return SonyReceiver.new(config[CONF_NAME], conf[CONF_DATA], conf[CONF_NBITS]) return SonyReceiver.new(config[CONF_NAME], conf[CONF_DATA], conf[CONF_NBITS])
elif CONF_RAW in config: elif CONF_RAW in config:
conf = config[CONF_RAW] data = ArrayInitializer(*config[CONF_RAW], multiline=False)
data = ArrayInitializer(*conf[CONF_DATA]) return RawReceiver.new(config[CONF_NAME], data)
return RawReceiver.new(data, conf[CONF_CARRIER_FREQUENCY])
else: else:
raise ValueError("Unknown receiver type {}".format(config)) raise ValueError("Unknown receiver type {}".format(config))
@ -72,7 +68,7 @@ def to_code(config):
remote = None remote = None
for remote in get_variable(config[CONF_REMOTE_RECEIVER_ID]): for remote in get_variable(config[CONF_REMOTE_RECEIVER_ID]):
yield yield
rhs = App.register_component(receiver_base(config)) rhs = receiver_base(config)
receiver = Pvariable(config[CONF_RECEIVER_ID], rhs) receiver = Pvariable(config[CONF_RECEIVER_ID], rhs)
binary_sensor.register_binary_sensor(remote.add_decoder(receiver), config) binary_sensor.register_binary_sensor(remote.add_decoder(receiver), config)

View file

@ -2,9 +2,9 @@ import voluptuous as vol
import esphomeyaml.config_validation as cv import esphomeyaml.config_validation as cv
from esphomeyaml import pins from esphomeyaml import pins
from esphomeyaml.const import CONF_DUMP, CONF_ID, CONF_PIN, CONF_TOLERANCE, CONF_BUFFER_SIZE, \ from esphomeyaml.const import CONF_BUFFER_SIZE, CONF_DUMP, CONF_FILTER, CONF_ID, CONF_IDLE, \
CONF_FILTER, CONF_IDLE CONF_PIN, CONF_TOLERANCE
from esphomeyaml.helpers import App, Pvariable, esphomelib_ns, gpio_input_pin_expression, add from esphomeyaml.helpers import App, Pvariable, add, esphomelib_ns, gpio_input_pin_expression
remote_ns = esphomelib_ns.namespace('remote') remote_ns = esphomelib_ns.namespace('remote')