Update czytnik-brama.yaml
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
esphome:
|
esphome:
|
||||||
name: terminal-brama
|
name: terminal-brama
|
||||||
|
# Punkt 1: Obniżenie taktowania procesora dla oszczędności energii i niższej temperatury
|
||||||
platformio_options:
|
platformio_options:
|
||||||
board_build.f_cpu: 80000000L # Oszczędność energii i niższa temperatura
|
board_build.f_cpu: 80000000L
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp32dev
|
board: esp32dev
|
||||||
@@ -11,7 +12,7 @@ esphome:
|
|||||||
wifi:
|
wifi:
|
||||||
ssid: !secret wifi_ssid
|
ssid: !secret wifi_ssid
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password
|
||||||
power_save_mode: LIGHT
|
power_save_mode: LIGHT # Punkt 3: Energooszczędny tryb WiFi
|
||||||
fast_connect: true
|
fast_connect: true
|
||||||
|
|
||||||
api:
|
api:
|
||||||
@@ -29,8 +30,10 @@ esphome:
|
|||||||
globals:
|
globals:
|
||||||
- id: g_imie
|
- id: g_imie
|
||||||
type: std::string
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
- id: g_nazwisko
|
- id: g_nazwisko
|
||||||
type: std::string
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
- id: status_karty
|
- id: status_karty
|
||||||
type: std::string
|
type: std::string
|
||||||
initial_value: '"Przyłóż kartę"'
|
initial_value: '"Przyłóż kartę"'
|
||||||
@@ -65,7 +68,7 @@ esphome:
|
|||||||
update_interval: 500ms
|
update_interval: 500ms
|
||||||
on_tag:
|
on_tag:
|
||||||
then:
|
then:
|
||||||
- display.page.show: strona_glowna
|
- display.page.show: strona_glowna # Wybudź ekran przy skanowaniu
|
||||||
- homeassistant.tag_scanned: !lambda 'return x;'
|
- homeassistant.tag_scanned: !lambda 'return x;'
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
@@ -86,7 +89,7 @@ esphome:
|
|||||||
- globals.set: { id: pokazuj_pracownika, value: 'false' }
|
- globals.set: { id: pokazuj_pracownika, value: 'false' }
|
||||||
- lambda: 'id(status_karty) = "Przyłóż kartę";'
|
- lambda: 'id(status_karty) = "Przyłóż kartę";'
|
||||||
- component.update: moj_ekran
|
- component.update: moj_ekran
|
||||||
- delay: 60s
|
- delay: 60s # Punkt 2: Czekaj minutę i wygaś ekran
|
||||||
- display.page.show: strona_pusta
|
- display.page.show: strona_pusta
|
||||||
|
|
||||||
display:
|
display:
|
||||||
@@ -105,7 +108,7 @@ esphome:
|
|||||||
it.print(64, 28, id(font_duza), TextAlign::TOP_CENTER, id(g_imie).c_str());
|
it.print(64, 28, id(font_duza), TextAlign::TOP_CENTER, id(g_imie).c_str());
|
||||||
it.print(64, 48, id(font_duza), TextAlign::TOP_CENTER, id(g_nazwisko).c_str());
|
it.print(64, 48, id(font_duza), TextAlign::TOP_CENTER, id(g_nazwisko).c_str());
|
||||||
}
|
}
|
||||||
- id: strona_pusta
|
- id: strona_pusta # Punkt 2: Pusta strona dla oszczędności OLED
|
||||||
lambda: |-
|
lambda: |-
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -136,7 +139,9 @@ esphome:
|
|||||||
- lambda: |-
|
- lambda: |-
|
||||||
std::string s = x;
|
std::string s = x;
|
||||||
if (s.empty() || s == "Przyłóż kartę") return;
|
if (s.empty() || s == "Przyłóż kartę") return;
|
||||||
id(moj_ekran)->show_page(id(strona_glowna));
|
|
||||||
|
id(moj_ekran)->show_page(id(strona_glowna)); // Wybudź ekran przy nowej wiadomości
|
||||||
|
|
||||||
if (s == "Brak Uprawnień") {
|
if (s == "Brak Uprawnień") {
|
||||||
id(pokazuj_pracownika) = false;
|
id(pokazuj_pracownika) = false;
|
||||||
id(status_karty) = "Brak Uprawnień";
|
id(status_karty) = "Brak Uprawnień";
|
||||||
@@ -154,4 +159,3 @@ esphome:
|
|||||||
}
|
}
|
||||||
id(timer_ekranu)->execute();
|
id(timer_ekranu)->execute();
|
||||||
- component.update: moj_ekran
|
- component.update: moj_ekran
|
||||||
|
|
||||||
Reference in New Issue
Block a user