()
| 436 | } |
| 437 | |
| 438 | async getSecurityPanel() { |
| 439 | if (this.securityPanel) { |
| 440 | return this.securityPanel |
| 441 | } |
| 442 | |
| 443 | const devices = await this.getDevices(), |
| 444 | securityPanel = devices.find((device) => { |
| 445 | return device.data.deviceType === RingDeviceType.SecurityPanel |
| 446 | }) |
| 447 | |
| 448 | if (!securityPanel) { |
| 449 | throw new Error( |
| 450 | `Could not find a security panel for location ${this.name} - ${this.id}`, |
| 451 | ) |
| 452 | } |
| 453 | |
| 454 | return (this.securityPanel = securityPanel) |
| 455 | } |
| 456 | |
| 457 | disarm() { |
| 458 | return this.setAlarmMode('none') |
no test coverage detected