@@ -19,7 +19,7 @@ external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
|
||||
ref: main
|
||||
ref: v4.3.2
|
||||
components:
|
||||
- nspanel_ha_blueprint_upload_tft
|
||||
refresh: 300s
|
||||
@@ -166,6 +166,15 @@ script:
|
||||
App.feed_wdt();
|
||||
}
|
||||
|
||||
- id: select_tft_file_model
|
||||
mode: restart
|
||||
then:
|
||||
- lambda: |-
|
||||
if (!isnan(display_mode->state) and !isnan(display_charset->state)) {
|
||||
std::string PanelModel = getNSPanelText(int(display_mode->state), int(display_charset->state));
|
||||
if (!PanelModel.empty() and tft_file_model->state != PanelModel) tft_file_model->publish_state(PanelModel);
|
||||
}
|
||||
|
||||
- id: !extend stop_all
|
||||
then:
|
||||
- lambda: |-
|
||||
@@ -413,16 +422,22 @@ select:
|
||||
icon: mdi:swap-horizontal
|
||||
|
||||
sensor:
|
||||
- id: !extend display_charset
|
||||
on_value:
|
||||
then:
|
||||
- script.execute: select_tft_file_model
|
||||
|
||||
- id: !extend display_mode
|
||||
on_value:
|
||||
then:
|
||||
lambda: |-
|
||||
static const char *const TAG = "addon_upload_tft.sensor.display_mode";
|
||||
id(tft_is_valid) = (display_mode->state > 0 and display_mode->state < 4);
|
||||
if (id(tft_is_valid))
|
||||
ESP_LOGD(TAG, "Valid TFT: True");
|
||||
else {
|
||||
ESP_LOGW(TAG, "Display mode: %i", int(display_mode->state));
|
||||
ESP_LOGW(TAG, "Valid TFT: False");
|
||||
}
|
||||
- lambda: |-
|
||||
static const char *const TAG = "addon_upload_tft.sensor.display_mode";
|
||||
id(tft_is_valid) = (display_mode->state > 0 and display_mode->state < 4);
|
||||
if (id(tft_is_valid)) {
|
||||
ESP_LOGD(TAG, "Valid TFT: True");
|
||||
select_tft_file_model->execute();
|
||||
} else {
|
||||
ESP_LOGW(TAG, "Display mode: %i", int(display_mode->state));
|
||||
ESP_LOGW(TAG, "Valid TFT: False");
|
||||
}
|
||||
...
|
||||
|
||||
@@ -96,7 +96,6 @@ time:
|
||||
- component.update: api_timestamp
|
||||
- component.update: device_timestamp
|
||||
|
||||
##### Web server #####
|
||||
web_server:
|
||||
id: web_server_std
|
||||
port: 80
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user