w kodzie od przycisku PUSH musisz dodać funkcję "round" taką jak w przycisku pobierz.
Dodatkowo w liniach poniżej musisz dodać ten round żeby zaokrąglił.
Dokładnie tak jak w przycisku PUSH
function round(n)
return math.floor((math.floor(n*2) + 1)/2)
end
selfId = fibaro:getSelfId()
miejsc="Ostrów Wielkopolski"
panstwo="pl"
local smartfon=878
HC3 = Net.FHttp("api.openweathermap.org")
danem, statusm = HC3:GET("/data/2.5/weather?q="..miejsc..","..panstwo.."&units=metric&lang=pl")
ajson=json.decode(danem)
tempmin=round(ajson.main.temp_min)
tempmax=round(ajson.main.temp_max)
cisn=round(ajson.main.pressure)
wilg=round(ajson.main.humidity)
wiatr=round(ajson.wind.speed)
zach=ajson.clouds.all
pogo=ajson.weather[1].description
fibaro:debug(pogo)
fibaro:call(selfId,"setProperty","ui.Label1.value",tempmin)
fibaro:call(selfId,"setProperty","ui.Label2.value",tempmax)
fibaro:call(selfId,"setProperty","ui.Label3.value",cisn)
fibaro:call(selfId,"setProperty","ui.Label4.value",wilg)
fibaro:call(selfId,"setProperty","ui.Label5.value",wiatr)
fibaro:call(selfId,"setProperty","ui.Label6.value",zach)
fibaro:call(selfId,"setProperty","ui.Label91.value",pogo)
wysylka="Pogoda: "..pogo..", Temp: "..tempmin
if tempmin~=tempmax then
wysylka=wysylka.."-"..tempmax
end
wysylka=wysylka..", Cisn: "..cisn..", Wilg: "..wilg..", Wiatr: "..wiatr
fibaro:call(smartfon, "sendPush", wysylka, wysylka)
Zaraz zaktualizuję wirtualkę w pierwszym poście. Dzięki andre za zwrócenie uwagi ;-)