reorganization

This commit is contained in:
Evgeny
2021-08-06 14:43:34 +03:00
parent 372ec8578d
commit 1e9b33eaea
52 changed files with 1044 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
ip_service_url = "https://freegeoip.app/json/"
addr_service_url = "https://nominatim.openstreetmap.org/reverse?format=json"
function on_alarm()
http:get(ip_service_url, "ip")
end
function on_network_result_ip(result)
local location = {
ajson:get_value(result, "object string:latitude"),
ajson:get_value(result, "object string:longitude")
}
http:get(addr_service_url.."&lat="..location[1].."&lon=".. location[2].."&addressdetails=1", "addr")
end
function on_network_result_addr(result)
local adr = ajson:get_value(result, "object string:display_name")
ui:show_text(adr)
end