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

Function builder

src/commands/edge/drivers/switch.ts:26–52  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

24const describe = 'change the driver used by an installed device'
25
26const builder = (yargs: Argv): Argv<CommandArgs> =>
27 apiCommandBuilder(yargs)
28 .positional('device-id', { describe: 'id of device to update', type: 'string' })
29 .option('hub', { alias: 'H', describe: 'hub id', type: 'string' })
30 .option('driver', { alias: 'd', describe: 'id of new driver to use', type: 'string' })
31 .option(
32 'include-non-matching',
33 {
34 alias: 'I',
35 describe: 'when presenting a list of drivers, include drivers that do not match the device',
36 type: 'boolean',
37 default: false,
38 },
39 )
40 .example([
41 ['$0 edge:drivers:switch', 'prompt for all necessary input'],
42 [
43 '$0 edge:drivers:switch --hub b0cd47c6-2bbd-45f7-9726-6dcd374b8eb3' +
44 ' --driver a5b0af0c-234a-4a8c-a927-6d70f91ad690 261131fb-916f-4936-a671-51b95360fe8e',
45 'switch to driver a5b0af... for device 261131... on hub b0cd47...',
46 ],
47 [
48 '$0 edge:drivers:switch --include-non-matching',
49 "include all available drivers in prompt, even if they don't match the chosen device",
50 ],
51 ])
52 .epilog(buildEpilog({ command, apiDocs: 'updateHubDevice' }))
53
54const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
55 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected