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

Function handler

src/commands/devices/health.ts:44–50  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

42 .epilog(buildEpilog({ command }))
43
44const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
45 const command = await apiCommand(argv)
46
47 const deviceId = await chooseDevice(command, argv.idOrIndex, { allowIndex: true })
48 const health = await command.client.devices.getHealth(deviceId)
49 await formatAndWriteItem(command, { tableFieldDefinitions: ['deviceId', 'state', 'lastUpdatedDate'] }, health)
50}
51
52const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
53export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
formatAndWriteItemFunction · 0.85

Tested by

no test coverage detected