Disable slider for a light which doesn't have a dimmer

Is it possible to do this? I tried to turn it off with a line of YAML I found, but I think it relates to custom UI and so lovelace fell back to defaults. In other words, it didn’t work!!

sn2