Skip to content

Commit

Permalink
Revert back build flags
Browse files Browse the repository at this point in the history
This was removed due to a bug on ESPHome 2024.6.0, however, as it was fixed later, I'm reverting back.
Hopefully this helps with #2176, #2168 and #2155
  • Loading branch information
edwardtfn committed Jul 11, 2024
1 parent 52826d5 commit f7923d8
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 118 deletions.
2 changes: 0 additions & 2 deletions components/nspanel_ha_blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

@coroutine_with_priority(1.0)
async def to_code(config):
cg.add_build_flag("-Wno-missing-field-initializers")

if CORE.using_arduino:
cg.add_build_flag("-DCONFIG_D0WD_PSRAM_CLK_IO=5")
cg.add_build_flag("-DCONFIG_D0WD_PSRAM_CS_IO=18")
Expand Down
4 changes: 2 additions & 2 deletions components/nspanel_ha_blueprint/upload_tft.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// upload_tft.cpp

// #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT

#include "upload_tft.h"

Expand Down Expand Up @@ -29,4 +29,4 @@ namespace nspanel_ha_blueprint {

} // namespace nspanel_ha_blueprint

// #endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
#endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
4 changes: 2 additions & 2 deletions components/nspanel_ha_blueprint/upload_tft.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma once

// #ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT

#include <string>

Expand Down Expand Up @@ -31,4 +31,4 @@ namespace nspanel_ha_blueprint {

} // namespace nspanel_ha_blueprint

// #endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
#endif // NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT
16 changes: 4 additions & 12 deletions esphome/nspanel_esphome_addon_ble_tracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#####################################################################################################
---

substitutions:
##### DON'T CHANGE THIS ######
NSPANEL_HA_BLUEPRINT_ADDON_BLE_TRACKER: "true"
##############################
esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_BLE_TRACKER

esp32_ble:
id: ble_component
Expand All @@ -20,14 +20,6 @@ esp32_ble:
esp32_ble_tracker:
id: ble_tracker

binary_sensor:
- id: ble_component_status
name: BLE component status
icon: mdi:bluetooth
entity_category: diagnostic
platform: template
lambda: return ble_component->is_active();

script:
- id: !extend dump_config
then:
Expand Down
34 changes: 5 additions & 29 deletions esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#####################################################################################################
---

substitutions:
##### DON'T CHANGE THIS ######
NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY: "true"
##############################
esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY

bluetooth_proxy:
id: ble_proxy

packages:
climate_base_package: !include nspanel_esphome_addon_ble_tracker.yaml
ble_base_package: !include nspanel_esphome_addon_ble_tracker.yaml

script:
- id: !extend dump_config
Expand All @@ -36,30 +36,6 @@ script:
ESP_LOGCONFIG(TAG, " Limit: %i", int(ble_proxy->get_bluetooth_connections_limit()));
}
#sensor:
# - id: ble_proxy_connections_free
# name: BLE Proxy connections free
# icon: mdi:bluetooth
# entity_category: diagnostic
# platform: template
# lambda: return ble_proxy->get_bluetooth_connections_free();

# - id: ble_proxy_connections_limit
# name: BLE Proxy connections limit
# icon: mdi:bluetooth
# entity_category: diagnostic
# platform: template
# lambda: return ble_proxy->get_bluetooth_connections_limit();

text_sensor:
- id: ble_proxy_mode
name: BLE Proxy mode
icon: mdi:bluetooth
entity_category: diagnostic
platform: template
lambda: |-
if (ble_proxy->has_active()) return {"Active"};
else return {"Passive"};
# Set Wi-Fi power save mode to "LIGHT" as required for Bluetooth on ESP32
wifi:
power_save_mode: LIGHT
Expand Down
64 changes: 34 additions & 30 deletions esphome/nspanel_esphome_addon_climate_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ substitutions:
addon_climate_cool: "false"
addon_climate_heat: "false"
addon_climate_dual: "false"
NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE: "true"
##############################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_BASE

climate:
- platform: thermostat
name: Thermostat
Expand Down Expand Up @@ -119,41 +123,41 @@ script:
#error "Invalid settings for add-on Climate. More than one option selected: Cool + Dual."
#elif defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
#error "Invalid settings for add-on Climate. More than one option selected: Heat + Dual."
// #elif !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
// #error "Invalid settings for add-on Climate. No option selected between Cool, Heat or Dual."
#elif !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT) && !defined(NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL)
#error "Invalid settings for add-on Climate. No option selected between Cool, Heat or Dual."
#endif
if (!id(is_uploading_tft)) {
static const char *const TAG = "nspanel_ha_blueprint";
const uint cooler_relay = ${cooler_relay};
const uint heater_relay = ${heater_relay};
ESP_LOGCONFIG(TAG, "Add-on climate:");
if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL}) {
ESP_LOGCONFIG(TAG, " Cool: Enabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGCONFIG(TAG, " Relay: %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay: %u", cooler_relay);
}
if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT}) {
ESP_LOGCONFIG(TAG, " Heat: Enabled");
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGCONFIG(TAG, " Relay: %u", heater_relay);
else
ESP_LOGE(TAG, " Relay: %u", heater_relay);
}
if (${NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL}) {
ESP_LOGCONFIG(TAG, " Dual: Enabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGCONFIG(TAG, " Relay (cooler): %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay);
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGCONFIG(TAG, " Relay (heater): %u", heater_relay);
else
ESP_LOGE(TAG, " Relay (heater): %u", heater_relay);
if (cooler_relay == heater_relay)
ESP_LOGE(TAG, " Double relay assignment");
}
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL
ESP_LOGCONFIG(TAG, " Cool: Enabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGCONFIG(TAG, " Relay: %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay: %u", cooler_relay);
#endif
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT
ESP_LOGCONFIG(TAG, " Heat: Enabled");
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGCONFIG(TAG, " Relay: %u", heater_relay);
else
ESP_LOGE(TAG, " Relay: %u", heater_relay);
#endif
#ifdef NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL
ESP_LOGCONFIG(TAG, " Dual: Enabled");
if (cooler_relay == 1 or cooler_relay == 2)
ESP_LOGCONFIG(TAG, " Relay (cooler): %u", cooler_relay);
else
ESP_LOGE(TAG, " Relay (cooler): %u", cooler_relay);
if (heater_relay == 1 or heater_relay == 2)
ESP_LOGCONFIG(TAG, " Relay (heater): %u", heater_relay);
else
ESP_LOGE(TAG, " Relay (heater): %u", heater_relay);
if (cooler_relay == heater_relay)
ESP_LOGE(TAG, " Double relay assignment");
#endif
}
- id: !extend init_hardware_climate
Expand Down
6 changes: 5 additions & 1 deletion esphome/nspanel_esphome_addon_climate_cool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ substitutions:

##### DO NOT CHANGE THIS #####
addon_climate_cool: "true"
NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL: "true"
##############################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_COOL

climate:
- id: !extend thermostat_embedded
min_cooling_off_time: ${min_off_time}s
Expand Down
6 changes: 5 additions & 1 deletion esphome/nspanel_esphome_addon_climate_dual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
substitutions:
##### DO NOT CHANGE THIS #####
addon_climate_dual: "true"
NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL: "true"
##############################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_DUAL

climate:
- id: !extend thermostat_embedded
min_cooling_off_time: ${min_off_time}s
Expand Down
6 changes: 5 additions & 1 deletion esphome/nspanel_esphome_addon_climate_heat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ substitutions:

##### DO NOT CHANGE THIS #####
addon_climate_heat: "true"
NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT: "true"
##############################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_CLIMATE_HEAT

climate:
- id: !extend thermostat_embedded
min_heating_off_time: ${min_off_time}s
Expand Down
19 changes: 9 additions & 10 deletions esphome/nspanel_esphome_addon_cover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ substitutions:
### Local cover defaults ###
interlock_wait_time: '250'

##### DON'T CHANGE THIS ######
NSPANEL_HA_BLUEPRINT_ADDON_COVER: "true"
##############################

esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_COVER
on_boot:
- priority: 700.29
then:
Expand All @@ -24,7 +23,7 @@ esphome:
- lambda: return cover_interlock_wait_time->has_state();
- lambda: return !isnan(cover_interlock_wait_time->state);
- lambda: |-
boot_log->execute("Set cover relay interlock");
boot_log->execute("Cover on_boot", "Set relay interlock");
relay_1->set_interlock_wait_time(cover_interlock_wait_time->state);
relay_2->set_interlock_wait_time(cover_interlock_wait_time->state);
- priority: 700.27
Expand All @@ -34,7 +33,7 @@ esphome:
- lambda: return cover_open_duration->has_state();
- lambda: return !isnan(cover_open_duration->state);
- lambda: |-
boot_log->execute("Set cover open duration");
boot_log->execute("Cover on_boot", "Set open duration");
cover_embedded->set_open_duration(cover_open_duration->state);
- priority: 700.26
then:
Expand All @@ -43,7 +42,7 @@ esphome:
- lambda: return cover_close_duration->has_state();
- lambda: return !isnan(cover_close_duration->state);
- lambda: |-
boot_log->execute("Set cover close duration");
boot_log->execute("Cover on_boot", "Set close duration");
cover_embedded->set_close_duration(cover_close_duration->state);
- priority: 700.24
then:
Expand All @@ -52,7 +51,7 @@ esphome:
- lambda: return cover_acceleration_wait_time->has_state();
- lambda: return !isnan(cover_acceleration_wait_time->state);
- lambda: |-
boot_log->execute("Set cover acc. wait time");
boot_log->execute("Cover on_boot", "Set acc. wait time");
cover_embedded->set_acceleration_wait_time(cover_acceleration_wait_time->state);
- priority: 700.23
then:
Expand All @@ -61,7 +60,7 @@ esphome:
- lambda: return cover_direction_change_wait_time->has_state();
- lambda: return !isnan(cover_direction_change_wait_time->state);
- lambda: |-
boot_log->execute("Set cover dir. change wait time");
boot_log->execute("Cover on_boot", "Set dir. change wait time");
cover_embedded->set_direction_change_waittime(cover_direction_change_wait_time->state);
- priority: 700.21
then:
Expand All @@ -70,7 +69,7 @@ esphome:
- lambda: return cover_device_class->has_state();
- lambda: return !(cover_device_class->state).empty();
- lambda: |-
boot_log->execute("Set cover device class");
boot_log->execute("Cover on_boot", "Set device class");
std::string lower_x = cover_device_class->state;
std::transform(lower_x.begin(), lower_x.end(), lower_x.begin(), ::tolower);
cover_embedded->set_device_class(lower_x.c_str());
Expand Down
7 changes: 4 additions & 3 deletions esphome/nspanel_esphome_addon_upload_tft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ substitutions:
nextion_update_url: "${nextion_update_base_url}/main/hmi/nspanel_blank.tft"
##############################################

##### DON'T CHANGE THIS ######
NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT: "true"
##############################
esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADDON_UPLOAD_TFT

# yamllint disable rule:comments-indentation
api:
Expand Down
7 changes: 4 additions & 3 deletions esphome/nspanel_esphome_advanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ substitutions:
web_password: ${wifi_password}
##############################

##### DON'T CHANGE THIS ######
NSPANEL_HA_BLUEPRINT_ADVANCED: "true"
##############################
esphome:
platformio_options:
build_flags:
- -D NSPANEL_HA_BLUEPRINT_ADVANCED

button:
- name: Exit reparse
Expand Down
Loading

0 comments on commit f7923d8

Please sign in to comment.