MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/locations/modes/delete.ts:37–48  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

35
36
37const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
38 const command = await apiCommand(argv)
39
40 const [modeId, locationId] = await chooseMode(command, argv.id, { locationId: argv.location })
41
42 const mode = await command.client.modes.get(modeId, locationId)
43 const name = mode.label ?? mode.name ?? 'unnamed mode'
44
45 await command.client.modes.delete(modeId, locationId)
46
47 console.log(`${name} (${mode.id}) deleted`)
48}
49
50const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
51export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
chooseModeFunction · 0.85

Tested by

no test coverage detected