Skip to content

Commit

Permalink
fix: Global commands catch all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed Jan 20, 2023
1 parent 5326af9 commit 91d43cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "npm run lint"
},
"dependencies": {
"@svrooij/sonos": "^2.6.0-beta.3",
"@svrooij/sonos": "^2.6.0-beta.4",
"mqtt": "4.3.7",
"serilogger": "^0.4.1",
"yalm": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/sonos-command-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class SonosCommandMapping {
}
} else if (typeof payload === 'string') {
return await device.AVTransportService.ConfigureSleepTimer({InstanceID: 0, NewSleepTimerDuration: payload})
} else if (payload === undefined) {
} else if (!payload) {
// Turn off sleep timer
return await device.AVTransportService.ConfigureSleepTimer({ InstanceID: 0, NewSleepTimerDuration: '' });
}
Expand Down
2 changes: 1 addition & 1 deletion src/sonos-to-mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class SonosToMqtt {
return Promise.all(this.sonosManager.Devices
.filter(d => d.Coordinator.Uuid === d.Uuid)
.map(d => d.Pause().catch(err =>{
this.log.warn('Device %s emitted an error %o', d.Uuid, err);
this.log.warn('Device {uuid} emitted an error {error}', d.Uuid, err);
})));

case 'listalarm': // This typ-o is still there for backward compatibility
Expand Down

0 comments on commit 91d43cb

Please sign in to comment.