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

Function handler

src/commands/devices/presentation.ts:46–56  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

44
45
46const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
47 const command = await apiCommand(argv)
48
49 const deviceId = await chooseDevice(command, argv.idOrIndex, { allowIndex: true })
50 const presentation = await command.client.devices.getPresentation(deviceId)
51 await formatAndWriteItem(
52 command,
53 { buildTableOutput: data => buildTableOutput(command.tableGenerator, data) },
54 presentation,
55 )
56}
57
58const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
59export default cmd

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
formatAndWriteItemFunction · 0.85
buildTableOutputFunction · 0.70

Tested by

no test coverage detected