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

Function handler

src/commands/virtualdevices/update.ts:46–55  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
chooseDeviceFnFunction · 0.85
buildTableOutputFunction · 0.50

Tested by

no test coverage detected