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

Function handler

src/commands/devices/rename.ts:36–48  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

34 .epilog(buildEpilog({ command, apiDocs: ['updateDevice'] }))
35
36const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
37 const command = await apiCommand(argv)
38
39 const id = await chooseDevice(command, argv.id)
40
41 const label = argv.newLabel ?? await stringInput('Enter new device label:')
42
43 await outputItem(
44 command,
45 { buildTableOutput: data => buildTableOutput(command.tableGenerator, data) },
46 () => command.client.devices.update(id, { label }),
47 )
48}
49
50const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
51export default cmd

Callers

nothing calls this directly

Calls 4

apiCommandFunction · 0.85
stringInputFunction · 0.85
outputItemFunction · 0.85
buildTableOutputFunction · 0.70

Tested by

no test coverage detected