Skip to content

Commit

Permalink
Do not throw error if no partition received
Browse files Browse the repository at this point in the history
  • Loading branch information
chase9 committed Mar 17, 2023
1 parent 2c58f68 commit 999a4e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ class ADCPlatform implements DynamicPlatformPlugin {

for (const device in res) {
if (device === 'partitions' && typeof res[device][0] === 'undefined') {
// throw error if no partition, ideally this should never occur
throw new Error('Received no partitions from Alarm.com');
// Debug log if no partition. This can happen when someone doesn't have monitoring.
this.log.debug(`Received no partitions from Alarm.com.`);
} else if (res[device].length > 0) {
this.log.info(`Received ${res[device].length} ${device} from Alarm.com`);

Expand Down

0 comments on commit 999a4e4

Please sign in to comment.