Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set/cancel Do-Not-Disturb for Ring Virtual Chime #49

Open
bujvary opened this issue Nov 4, 2023 · 0 comments
Open

Add ability to set/cancel Do-Not-Disturb for Ring Virtual Chime #49

bujvary opened this issue Nov 4, 2023 · 0 comments

Comments

@bujvary
Copy link

bujvary commented Nov 4, 2023

I updated my local Ring Virtual Chime with the ability to set/cancel Do-Not-Disturb. Here is the diff if you are willing to add it to your version.

35a38,39
>     command "snooze", [[name: "Set Snooze Length (in minutes)*", type: "NUMBER", range: "1..1440", description: "Choose a value between 1 and 1440 (24 hours)"]]
>     command "cancelSnooze"
89a94,106
> void snooze(snoozetime) {
>     // Value must be in [1, 1440]
>     snoozetime = Math.min(Math.max(snoozetime == null ? 1 : snoozetime.toInteger(), 1), 1440)
> 
>     final Integer sentValue = snoozetime
>     
>     parent.apiRequestDeviceControl(device.deviceNetworkId, "chimes", "do_not_disturb", [time: sentValue])
> }
> 
> void cancelSnooze() {
>     parent.apiRequestDeviceControl(device.deviceNetworkId, "chimes", "do_not_disturb", null)
> }
> 
175a193,200
>   else if (action == "do_not_disturb") {
>       if (query == null) {
>         logInfo "Device ${device.label} snooze cancelled"
>       }
>       else {
>         logInfo "Device ${device.label} snooze set to ${query?.time} minutes" 
>       }
>   }

Thanks,
Brian Ujvary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant