Comments (6)
Thanks @dgreif makes sense :)
If anyone wants to monitor alarm modes for their project hopefully this will be useful :)
if (locations.length) {
const myHome = locations[1]
myHome.onDeviceDataUpdate.subscribe(({mode}) => {
if (mode as AlarmMode) {
switch (mode as AlarmMode) {
case 'all':
console.log("away")
break;
case 'some':
console.log("home")
break;
case 'none':
console.log("disarmed")
break
default:
console.log("unknown")
break;
}
}
});
}
from ring.
Sorry!
As soon as I opened the enhancement I find that on Location you can have onDeviceDataUpdate so perhaps this is what I need!
Will update issue if this works out !
from ring.
I've written this to subscribe to LocationMode events and console.log(newMode) is never hit again after changing the alarm status from the ring app or keypad.
const myHome = locations[1]
console.log(myHome.name)
myHome.onLocationMode.subscribe((newMode) => {
console.log(newMode)
});
Any ideas?
from ring.
I've found the following which may help me
from ring.
Settled on this but I'm new to typescript!
myHome.onDeviceDataUpdate.subscribe(({mode}) => {
if (mode as AlarmMode) {
console.log(mode)
}
});
Wondering why mode encompasses both AlarmMode and ThermostatMode.
Is it nicer to make them separate in the API? Or is there something better I can do in my code?
Thanks! And sorry for all the comments on this thread!
from ring.
I do think onDeviceDataUpdate
is the best option for you to use. Keep in mind this is a fairly generic observable which emits data that matched the RingDeviceData interface. Since this is a generic type, mode
can be for an alarm security panel or a thermostat, which is why you get both of those mode types. This interface is blindly passing along the data from Ring, so there isn't any other more specific types available at the momemnt.
from ring.
Related Issues (20)
- myQ Integration HOT 1
- Alarm triggered when using Apple Home intercom HOT 2
- Front door Ring doorbell motion pop up notifications no longer show up on Apple TV 4K HOT 5
- Difference in quality between Ring Camera (getSnapshot) and video search HOT 1
- brief delay in HomePods chime when pressing intercom button HOT 3
- Live Streaming of camera fails after HomeKit architecture upgrade HOT 6
- RIng Server Failure with latest Node.JS HOT 1
- Ring Homebridge camera becomes non-responsive at Apple TV after ~ 5 minutes. HOT 4
- Ring Intercom HOT 1
- Trouble recording video to file or live streaming on an M1 Mac Mini HOT 3
- Ring Plugin v 12.1.0 works for everything but Live Video in Homebridge HOT 1
- Ring Door Opener not working anymore HOT 5
- Add Chime Pro Nightlight as Automation Option HOT 3
- Ring Intercom - not possible to choose which HomePods should ring HOT 8
- Strange error when viewing live streaming from "Home" app HOT 1
- Battery Level in Home
- Ring Intercom HOT 5
- Accessories not exposed to HomeKit HOT 1
- onDoorbellPressed not sending updates HOT 1
- Response Code 422 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ring.