Must we verify state before call service?

Hi,

i would like to know if it is necessary to test state of a device before call a service or if hass do it for us.
i means for exemple if i would like to call a light.turn_off, is it usefull to test if light state is not already off before calling the service, or hass do it and didn’t call the turn_off if the state is already off ?

the idea is just to optimize some things, and don’t launch a lot of useless command like a “all_off” script who will call something like group.all_light turn_off for maybe only one light to really turn_off

regards,

an other exemple for cover.
if we want to set a cover 100% down, will hass verify himself it it is not already 100%, or must we verifu that on our script ?

Nobody knows ?

Not sure about the cover example but I’ve got automations where the switch.turn_off service can be called for a switch that is already off. Doesn’t cause any issues.