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

Function handler

src/commands/locations/modes/update.ts:49–59  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

47 .epilog(buildEpilog({ command, apiDocs: 'updateMode' }))
48
49const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
50 const command = await apiCommand(argv)
51
52 const [modeId, locationId] = await chooseMode(command, argv.id, { locationId: argv.location })
53 const config: CommonOutputProducer<Mode> = { tableFieldDefinitions }
54 await inputAndOutputItem<ModeRequest, Mode>(
55 command,
56 config,
57 (_, data) => command.client.modes.update(modeId, data, locationId),
58 )
59}
60
61const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
62export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
chooseModeFunction · 0.85

Tested by

no test coverage detected