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

Function handler

src/commands/devices/update.ts:42–51  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

40 .epilog(buildEpilog({ command, apiDocs: ['updateDevice'] }))
41
42const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
43 const command = await apiCommand(argv)
44
45 const id = await chooseDevice(command, argv.id)
46 await inputAndOutputItem<DeviceUpdate, Device>(
47 command,
48 { buildTableOutput: data => buildTableOutput(command.tableGenerator, data) },
49 (_, data) => command.client.devices.update(id, data),
50 )
51}
52
53const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
54export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
buildTableOutputFunction · 0.70

Tested by

no test coverage detected