File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ def read():
126126 return await hass .async_add_executor_job (read )
127127
128128
129+ class IndentDumper (yaml .Dumper ):
130+ def increase_indent (self , flow = False , indentless = False ):
131+ return super (IndentDumper , self ).increase_indent (flow , False )
132+
133+
129134async def write_file (
130135 hass : HomeAssistant , path : str , content : Any , as_yaml = False
131136) -> None :
@@ -135,7 +140,12 @@ def write():
135140 with open (hass .config .path (path ), "w" ) as open_file :
136141 if as_yaml :
137142 yaml .dump (
138- content , open_file , default_flow_style = False , allow_unicode = True
143+ content ,
144+ open_file ,
145+ default_flow_style = False ,
146+ allow_unicode = True ,
147+ sort_keys = False ,
148+ Dumper = IndentDumper ,
139149 )
140150 else :
141151 open_file .write (content )
You can’t perform that action at this time.
0 commit comments