Skip to content

Commit

Permalink
Merge pull request #675 from deejaybeam/dev
Browse files Browse the repository at this point in the history
fix: button to exit reparse-mode on factory-device
  • Loading branch information
deejaybeam authored Apr 14, 2023
2 parents 433e83d + 9d822e7 commit 2627d99
Showing 1 changed file with 19 additions and 37 deletions.
56 changes: 19 additions & 37 deletions nspanel_esphome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ wifi:
esphome:
name: ${device_name}
min_version: 2022.10.2
on_boot:
priority: 601
then:
- lambda: id(disp1).send_command_printf("DRAKJHSUYDGBNCJHGJKSHBDN");

##### TYPE OF ESP BOARD #####
esp32:
Expand Down Expand Up @@ -126,9 +122,24 @@ button:
id: tft_update
entity_category: config
on_press:
- switch.turn_off: nextion_init
- delay: 16ms
- lambda: id(disp1).upload_tft();

##### EXIT REPARSE TFT DISPLAY #####
- platform: template
name: ${device_name} Exit reparse
icon: mdi:file-sync
id: tft_reparse_off
entity_category: config
on_press:
- uart.write:
id: tf_uart
data: "DRAKJHSUYDGBNCJHGJKSHBDN"
- uart.write:
id: tf_uart
data: [0xFF, 0xFF, 0xFF]

##### START - API CONFIGURATION #####
api:
##### advanced config - activate to use api_password #####
Expand All @@ -138,13 +149,15 @@ api:
##### SERVICE TO UPDATE THE HMI FILE #####
- service: upload_tft
then:
- switch.turn_off: nextion_init
- lambda: 'id(disp1)->upload_tft();'

##### SERVICE TO UPDATE THE TFT FILE from URL #####
- service: upload_tft_url
variables:
url: string
then:
- switch.turn_off: nextion_init
- lambda: 'id(disp1)->set_tft_url(url.c_str());'
- lambda: 'id(disp1)->upload_tft();'

Expand Down Expand Up @@ -497,18 +510,6 @@ binary_sensor:
on_click:
- switch.toggle: sleep_modus

##### Hotwater Charge #####
# - platform: nextion
# name: ${device_name} Hotwater Charge
# page_id: 6
# component_id: 20
# on_click:
# - homeassistant.service:
# service: switch.toggle
# data:
# entity_id: ${ha_hotwater_charge}


##### START - SENSOR CONFIGURATION #####
sensor:

Expand Down Expand Up @@ -601,17 +602,6 @@ sensor:
# send text field percentage of current_lightslider_val
- lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global));

###### Send current page to HA
# - platform: nextion
# id: current_page
# name: "${device_name} Current Page"
# variable_name: dp
# update_interval: 1s
# accuracy_decimals: 0
# filters:
# - delta: 1.0
# - lambda: return int(x);


##### START - TEXT SENSOR CONFIGURATION #####
text_sensor:
Expand Down Expand Up @@ -788,14 +778,6 @@ text_sensor:
##### START - SWITCH CONFIGURATION #####
switch:

# ##### Restart switch ######
# - platform: restart
# name: ${device_name} Restart

# ##### Restart in safe-mode #####
# - platform: safe_mode
# name: ${device_name} Restart (Safe Mode)

##### global variable to keep track on whether the Nextion display is ready or not. Delays initial info from HA to the display #####
- platform: template
name: ${device_name} Nextion inited
Expand Down Expand Up @@ -868,13 +850,13 @@ switch:
- globals.set:
id: sleep_modus_global
value: '0'
- lambda: id(disp1).set_component_value("settings.a02",0);
- lambda: id(disp1).set_component_value("settings.bt1",0);
on_turn_on:
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=1");
- globals.set:
id: sleep_modus_global
value: '1'
- lambda: id(disp1).set_component_value("settings.a02",1);
- lambda: id(disp1).set_component_value("settings.bt1",1);

##### Relay Local control Fallback #####
- platform: template
Expand Down

0 comments on commit 2627d99

Please sign in to comment.