Jump to content
C4 Forums | Control4

UI Button Driver


Capoesjon

Recommended Posts

Hi everybody!

The entire day I've tried to create a particular feature in the PS4_ui Button driver and I just can't seem to get it to work.

If I look at the driver I see options to have an icon in navigator when "idle" and when "selected". I want this icon to go back to "idle" when an other input is selected but it seems this is not an option.

do -- globals
    PROXY_CMDS = {}
        if (C4.GetDriverConfigInfo) then
        VERSION = C4:GetDriverConfigInfo ("version")
    else
        VERSION = 'Incompatible with this OS'
    end
    C4:UpdateProperty ('Driver Version', VERSION)
end

function ReceivedFromProxy (idBinding, strCommand, tParams)
    if type(PROXY_CMDS[strCommand]) == "function" then
        local success, retVal = pcall(PROXY_CMDS[strCommand], tParams)
        if success then
            return retVal
        end
    end
    return nil
end

function PROXY_CMDS.OFF (tParams)
    C4:SendToProxy(5001, "ICON_CHANGED", {icon = "Idle"})
end

function PROXY_CMDS.SELECT (tParams)
    C4:SendToProxy(5001, "ICON_CHANGED", {icon = "Selected"})
    local selection = string.upper(Properties["Selection"] or "Video")
    local deviceid = C4:GetProxyDevices(C4:GetDeviceID())
    if (selection == "VIDEO") then
        C4:SendToDevice (tParams.Room, 'SELECT_VIDEO_DEVICE', {deviceid = deviceid})
    else
        C4:SendToDevice (tParams.Room, 'SELECT_AUDIO_DEVICE', {deviceid = deviceid})
    end
end

 

I believe I need to add something to this LUA so the driver knows an other input has been selected. I tried all day but I my lack of experience is preventing me from succeeding..

Any help would be greatly appreciated!

Kind regards,

Capoesjon

PS4_Pro_CV2.c4z

Link to comment
Share on other sites


Are you saying you want to change the PS4 icon back to inactive if something else, ie a cable box is selected in that room?  If so you'd want to do that at the room level, not driver level.  

-> When family room video selection is changed

-> If family room video device selected is not PS4 -> set PS4 UI button to inactive

Link to comment
Share on other sites

Ah you're probably using the premade PS4 UI Icon driver which I don't believe has an active/inactive state.  If you saw that in documentation somewhere you were likely looking at the scenario experience driver which is the one you can do custom icons with and have an active and inactive icon. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.