Merge pull request #18 from borromeotlhs/patch-1
De-duplicate wifi.sta.getip() call
This commit is contained in:
commit
970906a89a
@ -79,8 +79,9 @@ return function (port)
|
|||||||
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
local ip = nil
|
-- false and nil evaluate as false
|
||||||
if wifi.sta.getip() then ip = wifi.sta.getip() else ip = wifi.ap.getip() end
|
local ip = wifi.sta.getip()
|
||||||
|
if not ip then ip = wifi.ap.getip() end
|
||||||
print("nodemcu-httpserver running at http://" .. ip .. ":" .. port)
|
print("nodemcu-httpserver running at http://" .. ip .. ":" .. port)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user