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

Function handler

src/commands/devices/status.ts:31–41  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

29 .epilog(buildEpilog({ command, apiDocs: ['getDeviceStatus'] }))
30
31const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
32 const command = await apiCommand(argv)
33
34 const deviceId = await chooseDevice(command, argv.idOrIndex, { allowIndex: true })
35 const presentation = await command.client.devices.getStatus(deviceId)
36 await formatAndWriteItem(
37 command,
38 { buildTableOutput: data => buildStatusTableOutput(command.tableGenerator, data) },
39 presentation,
40 )
41}
42
43const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
44export default cmd

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
formatAndWriteItemFunction · 0.85
buildStatusTableOutputFunction · 0.85

Tested by

no test coverage detected