Beetle-II / lumi

MQTT агент для шлюза Xiaomi DGNWG05LM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lumi/audio/volume - value with quotes

vnkorol opened this issue · comments

is it possible to make value with int or float type, not string with quotes?

it is fixing by changing gateway.js:

// Получаем состояние о громкости
function getVolume() {
audio.volume.value = cp.execSync("amixer get " + common.config.sound_channel + " | awk '$0~/%/{print $4}' | tr -d '[]%'").toString().split(os.EOL)[0];
mqtt.publish_value(audio.volume);

in gateway.js you should add string audio.volume.value = Number(audio.volume.value); after string audio.volume.value = cp.execSync("amixer get " + common.config.sound_channel + " | awk '$0~/%/{print $4}' | tr -d '[]%'").toString().split(os.EOL)[0]; ang get volume become number, not string