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:
Edward Firmo
2023-06-30 12:24:25 +02:00
committed by GitHub
parent ec48fbd335
commit 3aca4c64d2
24 changed files with 379 additions and 102 deletions

View File

@@ -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+"\"}"