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

Function handler

src/commands/edge/drivers/uninstall.ts:35–52  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

33 .epilog(buildEpilog({ command, apiDocs: 'uninstallDriver' }))
34
35const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
36 const command = await apiCommand(argv)
37
38 const hubId = await chooseHubFn({ withInstalledDriverId: argv.driverId })(
39 command,
40 argv.hub,
41 { promptMessage: 'Select a hub to uninstall from.' },
42 )
43
44 const listInstalledDrivers = (): Promise<InstalledDriver[]> => command.client.hubdevices.listInstalled(hubId)
45 const driverId = await chooseDriver(
46 command,
47 argv.driverId,
48 { promptMessage: 'Select a driver to uninstall.', listItems: listInstalledDrivers },
49 )
50 await command.client.hubdevices.uninstallDriver(driverId, hubId)
51 console.log(`Driver ${driverId} uninstalled from hub ${hubId}.`)
52}
53
54const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
55export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
chooseHubFnFunction · 0.85

Tested by

no test coverage detected