This commit is contained in:
Otto Winter 2019-04-24 18:11:46 +02:00
parent 5e5b9f2205
commit 0a0713f0e2
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E
2 changed files with 6 additions and 7 deletions

View file

@ -19,9 +19,9 @@ class Servo : public Component {
float level;
if (value < 0.0)
level = lerp(this->idle_level_, this->min_level_, -value);
level = lerp(-value, this->idle_level_, this->min_level_);
else
level = lerp(this->idle_level_, this->max_level_, value);
level = lerp(value, this->idle_level_, this->max_level_);
this->output_->set_level(level);
this->save_level_(level);

View file

@ -577,11 +577,10 @@ def _format_vol_invalid(ex, config):
class InvalidYAMLError(EsphomeError):
def __init__(self, path, base_exc):
message = u"Invalid YAML at {}. Please see YAML syntax reference or use an " \
u"online YAML syntax validator. ({})".format(path, base_exc)
def __init__(self, base_exc):
message = u"Invalid YAML syntax. Please see YAML syntax reference or use an " \
u"online YAML syntax validator:\n\n{}".format(base_exc)
super(InvalidYAMLError, self).__init__(message)
self.path = path
self.base_exc = base_exc
@ -589,7 +588,7 @@ def _load_config():
try:
config = yaml_util.load_yaml(CORE.config_path)
except EsphomeError as e:
raise InvalidYAMLError(CORE.config_path, e)
raise InvalidYAMLError(e)
CORE.raw_config = config
try: