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

Function handler

src/commands/edge/channels/unassign.ts:47–64  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

45
46
47const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
48 const command = await apiOrganizationCommand(argv)
49
50 const channelId = await chooseChannelFn({ withDriverId: argv.driverId })(
51 command,
52 argv.channel,
53 { useConfigDefault: true },
54 )
55 const driverId = await chooseDriverFromChannelFn(channelId)(
56 command,
57 argv.driverId,
58 { promptMessage: 'Select a driver to remove from the selected channel:' },
59 )
60
61 await command.client.channels.unassignDriver(channelId, driverId)
62
63 console.log(`${driverId} removed from channel ${channelId}`)
64}
65
66const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
67export default cmd

Callers

nothing calls this directly

Calls 3

apiOrganizationCommandFunction · 0.85
chooseChannelFnFunction · 0.85

Tested by

no test coverage detected