Command line switch format

My configuration.yaml
switch: !include_dir_named switches
in the directory switches I have switching.yaml

- platform: command_line
  switches:
    myswitch:
      command_on: "gpio -1 22 write 0"
      command_off: "gpio -1 22 write 1"
      command_state: "gpio -1 22 read"

The config_check gives me an error

Invalid config for [switch]: required key not provided @ data['platform']. Got None. (See /var/lib/hass/configuration.yaml, line 25)

I saw some inconsistency on the


The first sentence uses a minus in front of platform, but the following examples are not having that.

The question is
What it should be the correct formatting for a dir_named structure.

Not sure, but i think with dir_named, the filename is used for the entity.

I’d prefer packages

configuration.yaml

 homeassistant:
  ...
  # Packages
  packages: !include_dir_named packages

Then, in the packages folder you can create your yaml files like

sensor:
  ...

switch:
  ...

automation:
  ...

IMO the best way to keep track of your config.

I fully agreed with you. Today I accidentally delete all files. By packages is also much simpler to maintain.

A bit bumping the question. I was away for a week and I couldn’t find a solution. Meanwhile I had an upgrade to 0.97.4 and the configuration testing is not appearing as before.