mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Fix my9231 IDs not being resolved
This commit is contained in:
parent
f368255739
commit
9b07bb6608
@ -7,9 +7,9 @@ from esphomeyaml.const import (CONF_DATA_PIN, CONF_CLOCK_PIN, CONF_NUM_CHANNELS,
|
||||
CONF_NUM_CHIPS, CONF_BIT_DEPTH, CONF_ID,
|
||||
CONF_UPDATE_ON_BOOT)
|
||||
from esphomeyaml.helpers import (gpio_output_pin_expression, App, Pvariable,
|
||||
add, setup_component)
|
||||
add, setup_component, Component)
|
||||
|
||||
MY9231OutputComponent = output.output_ns.namespace('MY9231OutputComponent')
|
||||
MY9231OutputComponent = output.output_ns.class_('MY9231OutputComponent', Component)
|
||||
|
||||
|
||||
MY9231_SCHEMA = vol.Schema({
|
||||
|
@ -8,7 +8,7 @@ from esphomeyaml.helpers import Pvariable, get_variable, setup_component
|
||||
|
||||
DEPENDENCIES = ['my9231']
|
||||
|
||||
Channel = MY9231OutputComponent.Channel
|
||||
Channel = MY9231OutputComponent.class_('Channel', output.FloatOutput)
|
||||
|
||||
PLATFORM_SCHEMA = output.FLOAT_OUTPUT_PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_ID): cv.declare_variable_id(Channel),
|
||||
|
@ -16,6 +16,7 @@ from esphomeyaml.const import ARDUINO_VERSION_ESP32_DEV, ARDUINO_VERSION_ESP8266
|
||||
from esphomeyaml.core import ESPHomeYAMLError
|
||||
from esphomeyaml.helpers import App, NoArg, Pvariable, RawExpression, add, const_char_p, \
|
||||
esphomelib_ns, relative_path
|
||||
from esphomeyaml.util import safe_print
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -232,10 +233,16 @@ def update_esphomelib_repo(config):
|
||||
# local changes, cannot update
|
||||
_LOGGER.warn("Local changes in esphomelib copy from git. Will not auto-update.")
|
||||
return
|
||||
rc, _, _ = run_command('git', '-C', esphomelib_path, 'pull')
|
||||
_LOGGER.info("Updating esphomelib copy from git (%s)", esphomelib_path)
|
||||
rc, stdout, _ = run_command('git', '-c', 'color.ui=always', '-C', esphomelib_path,
|
||||
'pull', '--stat')
|
||||
if rc != 0:
|
||||
_LOGGER.warn("Couldn't auto-update local git copy of esphomelib.")
|
||||
return
|
||||
stdout = stdout.strip()
|
||||
if 'Already up to date' in stdout:
|
||||
return
|
||||
safe_print(stdout)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
|
Loading…
Reference in New Issue
Block a user