mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +01:00
Sort keys in dicts in output yaml for 'config' command (#1049)
Having different output each time due to random key order makes some tasks harder (such as CI scripts).
This commit is contained in:
parent
d1f4c2ab57
commit
64bd33a94e
1 changed files with 1 additions and 1 deletions
|
@ -338,7 +338,7 @@ class ESPHomeDumper(yaml.SafeDumper): # pylint: disable=too-many-ancestors
|
||||||
self.represented_objects[self.alias_key] = node
|
self.represented_objects[self.alias_key] = node
|
||||||
best_style = True
|
best_style = True
|
||||||
if hasattr(mapping, 'items'):
|
if hasattr(mapping, 'items'):
|
||||||
mapping = list(mapping.items())
|
mapping = sorted(mapping.items(), key=lambda item: item[0])
|
||||||
for item_key, item_value in mapping:
|
for item_key, item_value in mapping:
|
||||||
node_key = self.represent_data(item_key)
|
node_key = self.represent_data(item_key)
|
||||||
node_value = self.represent_data(item_value)
|
node_value = self.represent_data(item_value)
|
||||||
|
|
Loading…
Reference in a new issue