mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Fixes
This commit is contained in:
parent
5e5b9f2205
commit
0a0713f0e2
2 changed files with 6 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue