Reorg repo

Simplifies things
This commit is contained in:
Edward Firmo
2024-02-16 16:55:12 +01:00
parent 67e358b526
commit dc4a5f43e1
209 changed files with 66 additions and 195 deletions

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@ Nextion2Text.*
#dev
nspanel_esphome_prebuilt*.bin
/prebuilt

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

View File

@@ -7,10 +7,10 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
esp32:
framework:

View File

@@ -7,10 +7,10 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
esp32:
framework:

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../nspanel_esphome_addon_climate_cold.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../esphome/nspanel_esphome_addon_climate_cold.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

View File

@@ -7,10 +7,10 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../nspanel_esphome_addon_climate_cold.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../esphome/nspanel_esphome_addon_climate_cold.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
##### Customizations from Wiki #####
api:

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

View File

@@ -7,8 +7,8 @@ substitutions:
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../advanced/esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../nspanel_esphome_addon_climate_dual.yaml
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
# addon_climate_dual: !include ../esphome/nspanel_esphome_addon_climate_dual.yaml
...

15
advanced/.gitignore vendored
View File

@@ -1,15 +0,0 @@
# Ignore Mac DS_Store files
.DS_Store
**/.DS_Store
Nextion2Text.*
*.cmd
*.bat
# Ignore IntelliJ IDEA project directory
.idea
# Ignore dev folder
dev
#nspanel_esphome_prebuilt.yaml

View File

@@ -1,5 +0,0 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml

View File

@@ -1,133 +0,0 @@
########################
##### EXPERIMENTAL #####
########################
#####################################################################################################
##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint #####
##### ESPHOME PRE-BUILT #####
##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
##### For normal use with the Blueprint, no changes are necessary. #####
#####################################################################################################
---
substitutions:
device_name: nspanel
wifi_ssid: nspanel
wifi_password: NSPanel_Blueprint
pre_built: "true"
##### External components #####
external_components:
- source: github://pr#5586 # Remove this and update min ver when that PR is released
components:
- ota_http
refresh: 300s
packages:
core_package: !include ./nspanel_esphome_core.yaml # Core package
upload_tft_package: !include ./nspanel_esphome_addon_upload_tft.yaml # Core package
api:
services:
- service: firmware_update
variables:
url: string
then:
- ota_http.flash:
url: !lambda return url.c_str();
verify_ssl: false
- lambda: |-
static const char *const TAG = "prebuilt.button.bt_firmware_update";
ESP_LOGE(TAG, "Firmware update failed!");
button:
- name: Factory reset
platform: factory_reset
disabled_by_default: true
internal: false
- id: bt_firmware_update
name: Firmware update
platform: template
on_press:
then:
- ota_http.flash:
url: !lambda return id(firmware_url).state;
verify_ssl: false
- lambda: |-
static const char *const TAG = "prebuilt.button.bt_firmware_update";
ESP_LOGE(TAG, "Firmware update failed!");
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:
dashboard_import:
package_import_url: github://Blackymas/NSPanel_HA_Blueprint/advanced/esphome/nspanel_esphome_prebuilt.yaml # Must be updated
import_full_config: false
esp32:
framework:
type: esp-idf
# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none
esphome:
name_add_mac_suffix: true
project:
name: esphome.NSPanel_HA_Blueprint
version: "${version}"
on_boot:
- priority: 602.0
then:
- text_sensor.template.publish:
id: firmware_url
state: https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_esphome_prebuilt.bin
# Sets up the improv via serial client for Wi-Fi provisioning
improv_serial:
logger:
baud_rate: 115200
ota:
id: my_ota
password: !remove
ota_http:
script:
- id: !extend watchdog
then:
- lambda: |-
static const char *const TAG = "prebuilt.script.watchdog";
ESP_LOGI(TAG, "Pre-built version: ${pre_built}");
select:
- id: !extend tft_file_model
platform: template
options:
- "NSPanel Blank"
- "NSPanel EU"
- "NSPanel US"
- "NSPanel US Landscape"
- "NSPanel EU (CJK languages)"
- "NSPanel US (CJK languages)"
- "NSPanel US Landscape (CJK languages)"
initial_option: "NSPanel Blank"
text_sensor:
- id: firmware_url
name: Firmware update - URL
platform: template
update_interval: 60s
internal: true
web_server:
id: web_server_std
wifi:
ap: {}
power_save_mode: LIGHT # To make it compatible with BLE
...

View File

@@ -32,5 +32,5 @@ climate:
mode: "cool"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
climate_base_package: !include nspanel_esphome_addon_climate_base.yaml
...

View File

@@ -37,5 +37,5 @@ climate:
mode: "heat_cool"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
climate_base_package: !include nspanel_esphome_addon_climate_base.yaml
...

View File

@@ -32,5 +32,5 @@ climate:
mode: "heat"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
climate_base_package: !include nspanel_esphome_addon_climate_base.yaml
...

View File

@@ -42,6 +42,20 @@ esphome:
on_boot:
- priority: 600.0 # This is where most sensors are set up.
then:
- lambda: |-
std::string s = "${device_name}";
std::string result;
bool last_was_underscore = false;
for (char& c : s) {
if (isalnum(c)) {
result += tolower(c); // Add alphanumeric characters as lowercase
last_was_underscore = false;
} else if (!last_was_underscore) { // Replace non-alphanumeric with '_' but avoid consecutive '_'
result += '_';
last_was_underscore = true;
}
}
device_name->publish_state(result.c_str());
- script.execute: restore_settings
- wait_until:
condition:
@@ -1594,6 +1608,15 @@ switch:
##### START - TEXT SENSOR CONFIGURATION #####
text_sensor:
##### Device name - Used by bluepring to find service's names #####
- name: Device Name
id: device_name
platform: template
icon: mdi:identifier
entity_category: diagnostic
internal: false
disabled_by_default: false
##### Entity Id of the entity displayed on the detailed pages
- name: Detailed Entity
id: detailed_entity
@@ -1603,7 +1626,7 @@ text_sensor:
disabled_by_default: false
##### Current page name #####
- name: Current page
- name: Current Page
id: current_page
platform: template
icon: mdi:tablet-dashboard

View File

@@ -1,5 +1,5 @@
---
packages:
core_package: !include advanced/esphome/nspanel_esphome_core.yaml
upload_tft_package: !include advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
core_package: !include esphome/nspanel_esphome_core.yaml
upload_tft_package: !include esphome/nspanel_esphome_addon_upload_tft.yaml
...

Some files were not shown because too many files have changed in this diff Show More