SmartThingsCommunity / SmartThingsEdgeDrivers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG FIX: Bose Speaker Audio Notification - set Default 30 ONLY if error getting current volume of device

ketchumj1 opened this issue · comments

Right now, default is always set to 30. Having a new feature to automation is nice, but why not just keep the device at same volume it was instead of change to 30? the handler for volume up shows can get current volume, as seen below

local ip = device:get_field("ip")
local vol, _ = command.volume(ip)
if vol then
log.info(string.format("%s BoseCmd: volume up +5 {%s}", bose_utils.get_serial_number(device),
device.label, ip))
local err = command.set_volume(ip, vol.actual + 5)

@ketchumj1 Feel free to test with the invitation link in the PR prior to merge. I will also test later and merge. (If the PR has merged the invite link becomes invalid FYI)