mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 22:32:21 +01:00
Dashboard editor live validation (#540)
* Dashboard editor validation * Improve range detection * Lint
This commit is contained in:
@@ -233,15 +233,19 @@ class Config(OrderedDict):
|
||||
return err
|
||||
return None
|
||||
|
||||
def get_deepest_value_for_path(self, path):
|
||||
# type: (ConfigPath) -> ConfigType
|
||||
def get_deepest_document_range_for_path(self, path):
|
||||
# type: (ConfigPath) -> Optional[ESPHomeDataBase]
|
||||
data = self
|
||||
doc_range = None
|
||||
for item_index in path:
|
||||
try:
|
||||
data = data[item_index]
|
||||
except (KeyError, IndexError, TypeError):
|
||||
return data
|
||||
return data
|
||||
return doc_range
|
||||
if isinstance(data, ESPHomeDataBase) and data.esp_range is not None:
|
||||
doc_range = data.esp_range
|
||||
|
||||
return doc_range
|
||||
|
||||
def get_nested_item(self, path):
|
||||
# type: (ConfigPath) -> ConfigType
|
||||
|
Reference in New Issue
Block a user