Add option to show switches as lights

Switches have a “device_class” which currently has only 2 values, switch and outlet. Changing the device_class allows alternate icons for outlets. My suggestion is to add “light_controller” or “light_switch” as an additional device_class. This would enable the icon for the switch to be shown as a toggle, the same way it is shown for lights. There are quite a few reasons why this would be a good idea:

  • in the entities card, there are times when one may end up with a mixture of lights and switches.
    A common use case for this would be to create a control panel for guests / visitors to control the lighting in an area. Having two different sets of icons looks ugly and would be confusing to guests.
    As well as this, depending on the theme being used it is not always clear which of the two switch icons is active, and furthermore it can be confusing as to which icon indicates on and which is off.
    Yet another reason -in the entities card, you can have a global toggle in the header. This makes perfect sense when all the entity icons are also toggles, but once you add switches, it becomes visually confusing, as there is no cue that the header toggle and the switch icons are in some way connected.

I believe this could be a simple change, since there is already the outlet device_class, the same code could be adapted to the new light_switch class.

Thanks. I feel a bit foolish now, I just noticed there is even a helper callaed “Change device type of a switch”. I’d seen that before but hadn’t made the mental connection.