Ansuel / tch-nginx-gui

Modified file to apply to a stock technicolor GUI
GNU General Public License v3.0
341 stars 52 forks source link

More robust detection of model number. #346

Closed kevdagoat closed 5 years ago

kevdagoat commented 5 years ago

I think it would be good to implement a more robust model detection system (maybe in rootdevice?).

Currently this is what is present:

local variant = proxy.get("uci.env.var.prod_friendly_name")[1].value or "" local model = nil

if ( variant == "DGA4130" ) then model = "_AGTEF" elseif ( variant == "DGA4132" ) then model = "_AGTHP" elseif ( variant == "MediaAccess TG789vac v2" ) then model = "_TG789vac" elseif ( variant == "Technicolor TG799vac" ) then model = "_TG799vac" elseif ( variant == "Technicolor TG800vac" ) then model = "_TG800vac" end

What I would like to see

local variant = proxy.get("uci.env.var.determined_product")[1].value or "" local model = nil

if ( variant == "DGA4130" ) then model = "_AGTEF" elseif ( variant == "DGA4132" ) then model = "_AGTHP" elseif ( variant == "TG789vac" ) then model = "_TG789vac" elseif ( variant == "TG799vac" ) then model = "_TG799vac" elseif ( variant == "TG800vac" ) then model = "_TG800vac" end

scotty03 commented 5 years ago

Need to add this for the Myrepublic TG789

elseif ( variant == "MediaAccess TG789MYRvac v2 HP") then model = "_TG789vac" end

FrancYescO commented 5 years ago

rootscript is a more "critical" script i don't think that these detection should be added in this script... adding if case in the gateway modal (or a global lua func if needed) it's a better practice in this case

kevdagoat commented 5 years ago

Most likely not too much of an issue