Panel offline mode (#900)
* Panel offline mode Introduces "offline mode" for the panel, which will be used later with a fallback climate. Pages that are depending on the blueprint (buttons pages, entity pages, settings pages, etc) won't be shown when the API is disconnected. * Panel offline mode * Panel offline mode * Panel offline mode * Panel offline mode
This commit is contained in:
@@ -13,14 +13,20 @@ Page cover
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
page_label.txt=home.entity.txt
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
page_label.txt=home.entity.txt
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
|
||||
@@ -12,12 +12,19 @@ Page entitypage01
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"entitypage01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"entitypage01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -13,32 +13,38 @@ Page light
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
vis light_b_press,1
|
||||
vis lightslider,1
|
||||
vis light_value,1
|
||||
// #### OFF Button #####
|
||||
vis temp_b_press,0
|
||||
vis color_b_pres,0
|
||||
// #### OFF Value #####
|
||||
vis temp_value,0
|
||||
vis light_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis tempslider,0
|
||||
vis colorwheel,0
|
||||
// #### Hide color & temp buttons #####
|
||||
vis temp_touch,0
|
||||
vis temp_value_2,0
|
||||
vis temp_button,0
|
||||
vis color_touch,0
|
||||
vis color_button,0
|
||||
page_label.txt=home.entity.txt
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
vis light_b_press,1
|
||||
vis lightslider,1
|
||||
vis light_value,1
|
||||
// #### OFF Button #####
|
||||
vis temp_b_press,0
|
||||
vis color_b_pres,0
|
||||
// #### OFF Value #####
|
||||
vis temp_value,0
|
||||
vis light_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis tempslider,0
|
||||
vis colorwheel,0
|
||||
// #### Hide color & temp buttons #####
|
||||
vis temp_touch,0
|
||||
vis temp_value_2,0
|
||||
vis temp_button,0
|
||||
vis color_touch,0
|
||||
vis color_button,0
|
||||
page_label.txt=home.entity.txt
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
|
||||
|
||||
@@ -13,12 +13,18 @@ Page notification
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -13,12 +13,18 @@ Page qrcode
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -20,6 +20,9 @@ Page screensaver
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Touch Release Event
|
||||
page orign.val
|
||||
|
||||
Variable (int32) orign
|
||||
Attributes
|
||||
ID : 2
|
||||
|
||||
@@ -12,12 +12,19 @@ Page weather01
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -12,12 +12,19 @@ Page weather02
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather02\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather02\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -12,12 +12,19 @@ Page weather03
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather03\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather03\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -12,12 +12,19 @@ Page weather04
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather04\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather04\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
@@ -12,12 +12,19 @@ Page weather05
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather05\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
dim=home.brightness.val
|
||||
if(home.api.val==0)
|
||||
{
|
||||
page home
|
||||
}else
|
||||
{
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints "{\"page\": \"weather05\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
}
|
||||
|
||||
Touch Press Event
|
||||
printh 92
|
||||
|
||||
Reference in New Issue
Block a user