SmartThingsCommunity / smartthings-cli

Command-line Interface for the SmartThings APIs.
https://developer.smartthings.com/docs/sdks/cli/introduction
Apache License 2.0
234 stars 103 forks source link

smartthings edge:channels:unenroll unenrolls hubs from channels they weren't enrolled in to start with #479

Closed orangebucket closed 1 year ago

orangebucket commented 1 year ago

Describe the bug I don't know if you'd call this a bug or just an odd feature. However smartthings edge:channels:unenroll will allow you to 'unenroll' any hub you can manage from any channel your account is subscribed to, regardless of whether it is enrolled in it or not.

To Reproduce

Expected behavior I'd probably expect to be presented with a list of hubs, and then a list of channels that the hub is enrolled in, and then I'd expect that hub to be removed from that channel. So rather like smartthings edge:channels:enrollments with the extra step to unenroll tucked on the end.

Actual behavior If you type smartthings edge:channels:unenroll you get a list of all the channels you own or are subscribed to (including ones you'd love to unsubscribe to if only you could, but that's another issue). Regardless of which one you select you will get a list of all your hubs, and regardless of which hub you select you will apparently successfully unenroll that hub from the channel even though the hub isn't enrolled in that channel to start with, and you can do it again and again.

Update: Corrected the command to say 'unenroll'.

Additional context This arose from a discussion in https://community.smartthings.com/t/unenrolling-from-subscribed-channels/258175 which mentioned 'unenroll' a lot but was probably really about not being able to unsubscribe your account from channels you no longer have any interest in. For example I followed an invite in a PR to test a driver and now I'm not being allowed to forget it. While preparing an answer for that thread I got diverted to this issue instead.

rossiam commented 1 year ago

Completed in #513.