-- Lua Wetter App
-- version 1.0 - 1.3 (c) by tischi
-- version 1.4 by db2w-user
--- version 1.5 Markham
+-- version 1.6 Markham
-- Lizenz: GPL 2
--- Stand: 2.11.2015
+-- Stand: 22.05.2016
+-- V1.6 -- remove obsolete parameter for hide()
-- V1.5 -- improve luaweatherapp
-- V1.4 -- add. apikey thx. GetAway
-- apikey shamelessly stolen from the source code of the page http://openweathermap.org/current
+local posix = require "posix"
+local json = require "json"
+local n = neutrino()
+
-- Inputmethode hier angeben -- 0 fuer SMS; 1 fuer Keyboard
-KEYB=0;
+KEYB=1;
if KEYB == 1 then
inputmeth="keyboardinput"
end
--Variablen
-caption = "Wetter - Suche"
-pfad=script_path() .. "LuaWetterApp/"
+headdesc = "Wetterapp Einstellungen"
+pfad = script_path() .. "LuaWetterApp/"
txtpfad = "/tmp/Lua_Wetter/"
daten = txtpfad .. "luawetter.txt"
datentxt = txtpfad .. "wetterdaten.txt"
hintfarbe=COL.MENUCONTENT
textfarbe=COL.MENUCONTENT_TEXT
-local posix = require "posix"
-local json = require "json"
-local n = neutrino()
+
tagname={}
tagname["0"]="Sonntag"
tagname["1"]="Montag"
msg1, data1 = n:GetInput(500)
until msg1 == RC['home'] or msg1 == RC['setup'] or msg1 == RC['ok'] or i == 12; -- 6 seconds
- wh:hide{no_restore=true}
+ wh:hide()
end
--zuordnung Wochentage
config_error = false
config:loadConfig(confFile)
- conf["apikey"]= config:getString("apikey", "YOUR API KEY")
+ conf["apikey"]= config:getString("apikey", "1337beed73a13f60adbf71a486385104")
conf["farbe"] = config:getString("farbe", "COL.MENUCONTENT")
conf["land"] = config:getString("land", "de")
conf["name"] = config:getString("name", "Stadt")
configChanged = 0
posix.sleep(1)
- h:hide();
+ h:hide()
end
end
--Wetterdaten verbergen
function anzeigehide()
for i=16,1,-1 do
- anz[i]:hide{no_restore=true}
+ anz[i]:hide()
end
end
anz[14]=ctext.new{parent=w, x=dx+234, y=yy-120, dx=378, dy=50, text=lines[19], color_body=hintfarbe, color_text=textfarbe, font_text=FONT['MENU'], mode="ALIGN_CENTER" }
anz[15]=ctext.new{parent=w, x=x+100, y=yy-50, dx=400, dy=20, text="www.openweathermap.org", color_body=0xFF, color_text=COL['WHITE'], font_text=FONT['MENU'], mode="ALIGN_CENTER" }
-anz[16]=cpicture.new{parent=w, x=xx-310, y=yy-45 , dx=20, dy=10, image="menu", transparency=2, color_background=0xFF, mode="ALIGN_RIGHT"}
+anz[16]=cpicture.new{parent=w, x=xx-310, y=yy-50 , dx=20, dy=10, image="menu", transparency=2, color_background=0xFF, mode="ALIGN_RIGHT"}
anzeigepaint()
--Menüanzeigen
function addMenue()
- local m = menu.new{name=caption, icon=wettericon, has_shadow=true, mwidth=50}
+ local m = menu.new{name=headdesc, icon=wettericon, has_shadow=true, mwidth=50}
m:addKey{directkey = RC["home"], id = "home", action = "handle_key"}
m:addItem{type = "back"}
m:addItem{type="separatorline"}