Skip to content

Commit 91d43cb

Browse files
committed
fix: Global commands catch all errors
1 parent 5326af9 commit 91d43cb

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"test": "npm run lint"
2525
},
2626
"dependencies": {
27-
"@svrooij/sonos": "^2.6.0-beta.3",
27+
"@svrooij/sonos": "^2.6.0-beta.4",
2828
"mqtt": "4.3.7",
2929
"serilogger": "^0.4.1",
3030
"yalm": "4.1.0",

src/sonos-command-mapping.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class SonosCommandMapping {
136136
}
137137
} else if (typeof payload === 'string') {
138138
return await device.AVTransportService.ConfigureSleepTimer({InstanceID: 0, NewSleepTimerDuration: payload})
139-
} else if (payload === undefined) {
139+
} else if (!payload) {
140140
// Turn off sleep timer
141141
return await device.AVTransportService.ConfigureSleepTimer({ InstanceID: 0, NewSleepTimerDuration: '' });
142142
}

src/sonos-to-mqtt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class SonosToMqtt {
8484
return Promise.all(this.sonosManager.Devices
8585
.filter(d => d.Coordinator.Uuid === d.Uuid)
8686
.map(d => d.Pause().catch(err =>{
87-
this.log.warn('Device %s emitted an error %o', d.Uuid, err);
87+
this.log.warn('Device {uuid} emitted an error {error}', d.Uuid, err);
8888
})));
8989

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

0 commit comments

Comments
 (0)