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

Function handler

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
formatAndWriteItemFunction · 0.85
buildTableOutputFunction · 0.70

Tested by

no test coverage detected