My Lovelace config file,
ui-lovelace.yaml, was getting rather large, so I decided to split each view (tab) into its own file.
The neatest way, I thought, was to create a
ui-lovelace/ subdirectory and put one file per tab, then I could just use !include_dir_list to include them all.
This didn’t really work, though, because there was no way to control the order of the tabs! The list of files returned by !include_dir_list was undefined. So I contributed a tiny change to the code which meant that the files were returned in predictable alphanumeric order - you can change the order by renaming the files. This has now trickled through into the latest releases.
So my ui-lovelace.yaml now looks roughly like this:
title: My House views: !include_dir_list ui-lovelace/
and my ui-lovelace directory contains:
01-home.yaml 02-downstairs.yaml 03-upstairs.yaml 04-outside.yaml 05-misc.yaml
Each of these starts with:
title: Downstairs ....etc...
which determines the actual name of the tab.
Just in case it’s useful for anyone else…