Skip to content

Commit

Permalink
Fix my9231 IDs not being resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter committed Nov 13, 2018
1 parent f368255 commit 9b07bb6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions esphomeyaml/components/my9231.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
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({
Expand Down
2 changes: 1 addition & 1 deletion esphomeyaml/components/output/my9231.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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),
Expand Down
9 changes: 8 additions & 1 deletion esphomeyaml/core_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
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__)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 9b07bb6

Please sign in to comment.