Store OS in discovery data to use it for offline devices

This commit is contained in:
emanuele-f 2018-05-17 12:45:39 +02:00
parent dd941b21ad
commit b5a1cc1af7
2 changed files with 17 additions and 9 deletions

View file

@ -1229,15 +1229,20 @@ function discover.discover2table(interface_name, recache)
mdns, snmp[ip], snmpSysDescr[ip],
osx_devices[ip], sym)
if isEmptyString(device_label) then
local mac_info = interface.getMacInfo(mac)
local mac_info = interface.getMacInfo(mac)
if isEmptyString(device_label) then
entry["device_label_noicon"] = device_label
if mac_info ~= nil then
device_label = discover.devtype2icon(mac_info.devtype)
end
end
if mac_info ~= nil then
entry["os_type"] = mac_info.operatingSystem
end
interface.setMacDeviceType(mac, discover.devtype2id(device_type), false) -- false means don't overwrite if already set to ~= unknown
entry["device_type"] = device_type