Add in-home chime support to CLI#427
Conversation
sdb9696
left a comment
There was a problem hiding this comment.
This is a great PR, thanks for the effort!
I would suggest that this would be better implemented as a group of related commands rather than options (also using the click.BOOL and click.IntRange types as per the comments. This way the cli would look like:
ring-doorbell --device "Front Door" in-home-chime show # Shows all the settings
ring-doorbell --device "Front Door" in-home-chime # Defaults to show the settings
ring-doorbell --device "Front Door" in-home-chime enabled # Shows the enable state
ring-doorbell --device "Front Door" in-home-chime enabled y # Enables/Disables (from the docs: The string values “1”, “true”, “t”, “yes”, “y”, and “on” convert to True. “0”, “false”, “f”, “no”, “n”, and “off” convert to False.)
ring-doorbell --device "Front Door" in-home-chime duration # Shows the duration
ring-doorbell --device "Front Door" in-home-chime duration 5 # Sets the duration
ring-doorbell --device "Front Door" in-home-chime type # Shows the type
ring-doorbell --device "Front Door" in-home-chime duration Mechanical # Sets the type
You can set the device on the context in the main group command and pass_dev to the sub commands.
|
Hey just a heads up that I’ve converted the project to use |
|
@sdb9696 thank you! My concern with moving them from options to arguments is that it causes the help output to not be as helpful. Great call on moving |
Hey @briangoldstein, apologies for the delay in coming back to you. I've pushed a commit to your branch that hopefully explains what I'm trying to achieve. Essentially I'd like to keep the use of options as light as possible and stick to arguments for the most important part of a command. The help can go in the docstring and I think it looks ok. Some of the other commands like The downside is you can't set multiple in-home-chime settings in one go but I think that's ok. There's also some other clean up in there, let me know your thoughts. |
## [0.9.5](https://github.com/python-ring-doorbell/python-ring-doorbell/tree/0.9.5) (2024-09-19) [Full Changelog](0.9.4...0.9.5) **Release highlights:** - New CLI commands - Enhancement to the experimental WebRTC stream feature **Implemented enhancements:** - Enable multiple webrtc sessions per device [\#440](#440) (@sdb9696) - Add cli command to open door on intercom [\#438](#438) (@sdb9696) - Add in-home chime support to CLI [\#427](#427) (@briangoldstein) **Fixed bugs:** - Fix max. volume of Ring Chime device. [\#439](#439) (@daniel-k) - Fix cli listen command on windows [\#437](#437) (@sdb9696) **Project maintenance:** - Fix testpypi publish workflow to skip duplicates [\#441](#441) (@sdb9696) - Tweak the CI to use variables for project names [\#435](#435) (@sdb9696) - Fix publish workflow action [\#434](#434) (@sdb9696) - Upgrade artifact upload/download github actions [\#433](#433) (@sdb9696) **Closed issues:** - pyproject include = \["LICENSE", "CONTRIBUTING.rst"...\] [\#324](#324)



Added a command
in-home-chimewhich supports viewing the current in-home chime settings for a device as well as changing any of the available settings using multiple arguments.Sample output of
ring-doorbell in-home-chime --device-name "Front Door"Output of
ring-doorbell in-home-chime --help