- local num = { }
- local dev = _uci_real:get("network", self.sid, "ifname") or
- _uci_state:get("network", self.sid, "ifname")
-
- dev = (type(dev) == "table") and dev[1] or dev
- dev = (dev ~= nil) and dev:match("%S+")
-
- if not dev then
- _uci_real:foreach("wireless", "wifi-iface",
- function(s)
- if s.device then
- num[s.device] = num[s.device]
- and num[s.device] + 1 or 1
+ ifname = self:_ubus("device")
+ end
+ if not ifname then
+ _uci_real:foreach("wireless", "wifi-iface",
+ function(s)
+ if s.device then
+ num[s.device] = num[s.device]
+ and num[s.device] + 1 or 1