mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-10-14 08:35:12 +02:00
nspanel-patio: jump straight to the Von card
Temporarily make it the default page and render it once, instead of rendering home, next and next.
This commit is contained in:
1 parent
271a5a5a54
commit
0d6aa6e3d7
1 file changed
+13
-6
+13
-6
@@ -37,6 +37,7 @@ nspanel_lovelace:
|
|||||||
cards:
|
cards:
|
||||||
- type: cardGrid
|
- type: cardGrid
|
||||||
title: Kuchyňa / Obývačka
|
title: Kuchyňa / Obývačka
|
||||||
|
id: card_home
|
||||||
entities:
|
entities:
|
||||||
- name: Kuchyňa / Obývačka
|
- name: Kuchyňa / Obývačka
|
||||||
entity_id: light.kitchen
|
entity_id: light.kitchen
|
||||||
@@ -69,6 +70,7 @@ nspanel_lovelace:
|
|||||||
|
|
||||||
- type: cardGrid
|
- type: cardGrid
|
||||||
title: Von
|
title: Von
|
||||||
|
id: card_outside
|
||||||
entities:
|
entities:
|
||||||
- name: Terasa
|
- name: Terasa
|
||||||
entity_id: light.patio_lights
|
entity_id: light.patio_lights
|
||||||
@@ -166,9 +168,7 @@ binary_sensor:
|
|||||||
inverted: true
|
inverted: true
|
||||||
on_click:
|
on_click:
|
||||||
- switch.toggle: relay_1
|
- switch.toggle: relay_1
|
||||||
- lambda: 'id(nspanel_id).render_default_page();'
|
- script.execute: show_outside_card
|
||||||
- lambda: 'id(nspanel_id).render_next_page();'
|
|
||||||
- lambda: 'id(nspanel_id).render_next_page();'
|
|
||||||
|
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: Right Button
|
name: Right Button
|
||||||
@@ -187,9 +187,7 @@ binary_sensor:
|
|||||||
action: light.toggle
|
action: light.toggle
|
||||||
data:
|
data:
|
||||||
entity_id: light.patio_lights
|
entity_id: light.patio_lights
|
||||||
- lambda: 'id(nspanel_id).render_default_page();'
|
- script.execute: show_outside_card
|
||||||
- lambda: 'id(nspanel_id).render_next_page();'
|
|
||||||
- lambda: 'id(nspanel_id).render_next_page();'
|
|
||||||
else:
|
else:
|
||||||
- switch.toggle: relay_2
|
- switch.toggle: relay_2
|
||||||
|
|
||||||
@@ -212,3 +210,12 @@ switch:
|
|||||||
pin:
|
pin:
|
||||||
number: 19
|
number: 19
|
||||||
|
|
||||||
|
script:
|
||||||
|
# jump straight to the "Von" card (one render instead of home + next + next):
|
||||||
|
# make it the default page for a moment, render it, restore the home card
|
||||||
|
- id: show_outside_card
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(nspanel_id).set_default_page("card_outside");
|
||||||
|
id(nspanel_id).render_default_page();
|
||||||
|
id(nspanel_id).set_default_page("card_home");
|
||||||
Reference in new issue
Block a user