Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lumi/audio/volume - value with quotes #16

Open
vnkorol opened this issue May 9, 2021 · 2 comments
Open

lumi/audio/volume - value with quotes #16

vnkorol opened this issue May 9, 2021 · 2 comments

Comments

@vnkorol
Copy link

vnkorol commented May 9, 2021

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

@vnkorol
Copy link
Author

vnkorol commented May 9, 2021

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);

@iPavel89-work
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants