In customize_glob.yaml I have code to change icon and color for switches.
Icon works correctly, but color change only for “on” state, for off I have default blue color, why ?
switch.out*:
templates:
icon: >
if (state === 'on') return 'mdi:toggle-switch';
else return 'mdi:toggle-switch-off';
hs_color: >
if (state === 'on') return [58, 87, 47];
else return [353,65,45];