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

Function builder

src/commands/deviceprofiles/view/update.ts:37–77  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

35const describe = 'update a device profile and its device configuration'
36
37const builder = (yargs: Argv): Argv<CommandArgs> =>
38 inputAndOutputItemBuilder(apiOrganizationCommandBuilder(yargs))
39 .positional('id', { describe: 'device profile id', type: 'string' })
40 .example([
41 [
42 '$0 deviceprofiles:view:update --input test.yaml',
43 'prompt for a device profile and update it and its device configuration as defined in test.yaml',
44 ],
45 [
46 '$0 deviceprofiles:view:update 84042863-0d34-4c5c-b497-808daf230787 --input test.json',
47 'update the specified device profile and its device configuration as defined in test.json',
48 ],
49 ])
50 .epilog(buildEpilog({
51 command,
52 formattedNotes:
53 ' Updates a device profile and device configuration and sets the vid of the profile ' +
54 'to the vid of the updated configuration. Unlike deviceprofiles:update this ' +
55 'command accepts a consolidated object that can include a device configuration ' +
56 'in a property named "view".\n\n' +
57 ' This sample file adds the powerMeter capability to the device and makes it available in' +
58 'the device detail view but not the rule builder:\n\n' +
59 ' components:\n' +
60 ' - id: main\n' +
61 ' capabilities:\n' +
62 ' - id: switch\n' +
63 ' - id: powerMeter\n' +
64 ' view:\n' +
65 ' dashboard:\n' +
66 ' states:\n' +
67 ' - capability: switch\n' +
68 ' actions:\n' +
69 ' - capability: switch\n' +
70 ' detailView:\n' +
71 ' - capability: switch\n' +
72 ' - capability: powerMeter\n' +
73 ' automation:\n' +
74 ' conditions:\n' +
75 ' - capability: switch',
76 apiDocs: ['createDeviceConfiguration', 'updateDeviceProfile', 'generateDeviceConfig'],
77 }))
78
79const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
80 const command = await apiOrganizationCommand(argv)

Callers

nothing calls this directly

Calls 3

buildEpilogFunction · 0.85

Tested by

no test coverage detected