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

Volume control extension assignment to zones #3

Open
DrCWO opened this issue Aug 20, 2020 · 0 comments
Open

Volume control extension assignment to zones #3

DrCWO opened this issue Aug 20, 2020 · 0 comments

Comments

@DrCWO
Copy link

DrCWO commented Aug 20, 2020

Hello,
I am a bit frustrated. Trying to build a roon volume extension based on one of the may volume extensions around in git.
Anything seems to be OK but the volume control is NOT SHOWN in any of my zones.
I also implemented a source control. This shows up in the settings of the zones, I can activate it (assign it to the Zone) and it works. So please would someone be so nice to have a look at my code and give me an idea why the volume control is invisible.
Help would be appreciated :-)

One more hint: the functions av_getVolume and av_getMute are called and deliver appropriate values.

    av.volume_control = svc_volume_control.new_device({
        state: {
            display_name: "Volume",
            volume_type: "number",
            volume_min: 0,
            volume_max: 100,
            volume_value: av_getVolume(),
            volume_step: 1.0,
            is_muted: av_getMute()
        },
        set_volume: function (req, mode, newvol) {
            console.log("************** NEW Volume: " + newvol);
            ev_volume(newvol);
            req.send_complete("Success");
        },
        set_mute: function (req, action) {
            if (action == "on") {
                this.state.is_muted = true;
                console.log("************** MUTE");
                ev_mute(true);
            }
            else if (action == "off") {
                this.state.is_muted = false;
                console.log("*********** UNMUTE");
                ev_mute(false);
            }
            req.send_complete("Success");
        }
    });

    console.log ("***** INIT Source Control");
    av.source_control = svc_source_control.new_device({
        state: {
            display_name: "Power Off",
            supports_standby: true,
            status: "selected"
        },
        standby: function (req) {
            this.state.status = "standby";
        // console.log("******************* Sent power off command!");
        req.send_complete("Success");
        ev_standby("Standby");
        }
    });
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

1 participant