WTH do actions for alarm, cover, and lawn_mower repeat their domain as a noun?

TL;DR: We don’t have actions called switch.turn_off_switch or light.turn_on_light, so we shouldn’t have actions called things like cover.open_cover or cover.close_cover.

There are a small number of action names that repeat their domain name as a noun within the action name. I reviewed the actions for every domain listed in the HA docs and these are the only ones that reuse the domain name in the action name as a noun:

alarm.alarm_arm_MODE [home, away, night, vacation, custom_bypass]
alarm.alarm_disarm
alarm.alarm_trigger

cover.[open|close]_cover
cover.toggle
cover.[open|close]_cover_tilt
cover.toggle_tilt

lawn_mower.start_mowing
lawn_mower.pause
lawn_mower.dock

Instead, I think these actions should be named:

alarm.arm_MODE [home, away, night, vacation, custom_bypass]
alarm.disarm
alarm.trigger

cover.[open|close]
cover.toggle
cover.[open|close]_tilt
cover.toggle_tilt

lawn_mower.start
lawn_mower.pause
lawn_mower.dock

This one is borderline, but you could argue “select” is a verb in the action name:

select.select_[first,last,next,option]

I excluded these two domains because you could write a WTH about them alone:

media_player
notify

(Side note: Someone please write a WTH about how confusing it is that media_player.play_media and media_player.media_play do different things)

Finally, here are all the other domains’ actions. None of these include the domain as a noun in their action names.

button.press
calendar.VERB_event(s) [create, get] 
camera.[dis|en]able_motion_detection
camera.play_stream
camera.VERB [record, snapshot]
camera.turn_[off|on]
climate.set_ATTRIBUTE [aux_heat, preset_mode, temperature, humidity, fan_mode, hvac_mode, swing_mode, swing_horizontal_angle]
climate.turn_[off|on]
date.set_value
datetime.set_value
device_tracker.see
fan.set_ATTRIBUTE [percentage, preset_mode, direction]
fan.turn[off|on]
fan.toggle
fan.[in|de]crease_speed
fan.oscilate
humidifier.set_ATTRIBUTE [mode, humidity]
humidifier.turn_[off|on]
humidifier.toggle
image.snapshot
light.turn_[off|on]
light.toggle
lock.VERB [lock, unlock, open]
number.set_value
remote.turn_[off|on]
remote.toggle
remote.send_command
scene.turn_on
scene.VERB [apply, create, delete]
siren.turn_[off|on]
siren.toggle
switch.turn_[off|on]
switch.toggle
text.set_value
time.set_value
todo.VERB_NOUN [get_items, add_item, update_item, remove_item, remove_completed_items]

(Side note: Someone please write a WTH about how confusing it is that media_player.play_media and media_player.media_play do different things)

I might have actually already done that without realizing it are 2 different things under the hood since they have the same name in the UI.

1 Like