Skip to content

Commit

Permalink
some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-burgfried committed Feb 24, 2019
1 parent ca70c64 commit a234bc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,13 @@ async function handleVolumeCommand (device, payload, modifier) {
}
}
}
log.info('Change %j', change)

return device.getVolume()
.then(vol => {
log.info('Old volume %j', vol)
let tempVol = vol + (change * modifier)
log.info('New volume %j', tempVol)
if (tempVol > 100) {
return 100
}
Expand All @@ -227,7 +230,7 @@ async function handleVolumeCommand (device, payload, modifier) {
}
return tempVol
})
.then(device.setVolume)
.then(vol => { return device.setVolume(vol) })
.then(result => {
log.info('Volume changed %d', (change * modifier))
})
Expand Down

0 comments on commit a234bc8

Please sign in to comment.