-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
ring: fix location mode subscriptions #646
Conversation
|
||
// if the location has a base station, updates when arming/disarming are not sent to the `onLocationMode` subscription | ||
// instead we subscribe to the security panel, which is updated during arming actions | ||
this.location.getSecurityPanel().then(panel => { | ||
panel.onData.subscribe(_ => { | ||
this.location.getLocationMode().then(response => { | ||
this.updateLocationMode(response.mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateLocationMode
call no needed, as it's subscribed to on the line above
if (!this.securitySystemState) { | ||
this.updateLocationMode('disabled'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't find a case when this was needed, if the idea is to initialize the securitySystemState
I can add that before all the subscription logic
this.location = location; | ||
|
||
this.location.onLocationMode.subscribe(this.updateLocationMode); | ||
this.location.onLocationMode.subscribe(mode => this.updateLocationMode(mode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was causing an actual error, I guess function passing doesn't work as I expected in typescript
the fix for probing the devices on startup is in this pr too.