From 4a0035d6079be9ac0907c90ae9d34d33e1e19a10 Mon Sep 17 00:00:00 2001 From: Nicolas Bachschwell Date: Thu, 4 Dec 2025 01:47:24 +0100 Subject: [PATCH] Updated hoerman_door to esphome 2025.11.3... Breaking changes existed in 2025.11.0 See https://github.com/esphome/esphome/pull/11704 for more information --- .../hoermann_door/cover_component.h | 25 ++++++++++++++++++- .../hoermann_door/hciemulator.cpp | 6 ++--- .../hoermann_door/hciemulator.h | 2 +- external_components/hoermann_door/hoermann.h | 14 +++++------ .../hoermann_door/light_component.h | 6 ++--- garage1.yaml | 3 ++- 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/external_components/hoermann_door/cover_component.h b/external_components/hoermann_door/cover_component.h index 729ab43..2e9258f 100644 --- a/external_components/hoermann_door/cover_component.h +++ b/external_components/hoermann_door/cover_component.h @@ -14,6 +14,12 @@ namespace esphome { namespace hoermann_door { +enum DoorOpeningState { + OPENING = 0, + CLOSING = 1, + NO_ACTION = 2 +}; + class HoermannDoor : public Component, public cover::Cover { private: @@ -53,12 +59,29 @@ public: manual = false; } else{ - ESP_LOGD(COMP_TAG, "Not yet supported"); + uint8_t state = mainComponent->getEmulator()->getState().doorCurrentPosition; + + switch(state){ + case DoorState::DOOR_CLOSE_POSITION: + case DoorState::DOOR_OPEN_POSITION: + case DoorState::DOOR_HALF_POSITION: + + break; + case DoorState::DOOR_MOVE_CLOSEPOSITION: + + break; + case DoorState::DOOR_MOVE_OPENPOSITION: + + break; + default: + ESP_LOGE(TAG, "ERROR, HCIEmulator reported door state as something else than normal values"); + } } } if (call.get_stop()) { mainComponent->getEmulator()->stopDoor(); + } //if(call.get_close()) { //emulator.closeDoor(); diff --git a/external_components/hoermann_door/hciemulator.cpp b/external_components/hoermann_door/hciemulator.cpp index 4703433..e903ebc 100644 --- a/external_components/hoermann_door/hciemulator.cpp +++ b/external_components/hoermann_door/hciemulator.cpp @@ -37,12 +37,12 @@ void LogCore(int Level, const char *msg, const unsigned char *data = NULL, size_ str[3] = '\0'; strncat(newmsg, str, sizeof(str)); } - ESP_LOGD(TAG, newmsg); + ESP_LOGD(EM_TAG, newmsg); free(newmsg); } else { - ESP_LOGD(TAG, msg); + ESP_LOGD(EM_TAG, msg); } } //#else @@ -195,7 +195,7 @@ void HCIEmulator::poll() } else { - ESP_LOGD(TAG, "skipped frame"); + ESP_LOGD(EM_TAG, "skipped frame"); } m_skipFrame = false; diff --git a/external_components/hoermann_door/hciemulator.h b/external_components/hoermann_door/hciemulator.h index 1f27ebf..5306ec4 100644 --- a/external_components/hoermann_door/hciemulator.h +++ b/external_components/hoermann_door/hciemulator.h @@ -27,7 +27,7 @@ namespace esphome { namespace hoermann_door { -static const char *const TAG = "HCIEmulator"; +static const char *const EM_TAG = "HCIEmulator"; enum DoorState : uint8_t { diff --git a/external_components/hoermann_door/hoermann.h b/external_components/hoermann_door/hoermann.h index cef8678..ab827bd 100644 --- a/external_components/hoermann_door/hoermann.h +++ b/external_components/hoermann_door/hoermann.h @@ -12,7 +12,7 @@ class HoermannMainComponent; namespace esphome { namespace hoermann_door { -static const char *const COMP_TAG = "Hoermann"; +static const char *const TAG = "Hoermann"; void dispatcherFn(void *arg); @@ -100,11 +100,11 @@ class HoermannMainComponent: public Component{ } void dump_config() override { - ESP_LOGCONFIG(COMP_TAG, "hoermann_door_component:"); - ESP_LOGCONFIG(COMP_TAG, " UART: "); - ESP_LOGCONFIG(COMP_TAG, " UART is configured"); + ESP_LOGCONFIG(TAG, "hoermann_door_component:"); + ESP_LOGCONFIG(TAG, " UART: "); + ESP_LOGCONFIG(TAG, " UART is configured"); LOG_PIN(" TX_ON_PIN", this->_tx_on); - ESP_LOGCONFIG(COMP_TAG, " Log Level: %d", this->log_level); + ESP_LOGCONFIG(TAG, " Log Level: %d", this->log_level); } }; @@ -118,7 +118,7 @@ template class StopPollingAction: public Action { public: StopPollingAction(HoermannMainComponent *motor) : motor_(motor) {} - void play(Ts... x) override { this->motor_->stop_polling(); } + void play(const Ts &...x) override { this->motor_->stop_polling(); } protected: HoermannMainComponent *motor_; @@ -127,7 +127,7 @@ template class StartPollingAction: public Action { public: StartPollingAction(HoermannMainComponent *motor) : motor_(motor) {} - void play(Ts... x) override { this->motor_->start_polling(); } + void play(const Ts &...x) override { this->motor_->start_polling(); } protected: HoermannMainComponent *motor_; diff --git a/external_components/hoermann_door/light_component.h b/external_components/hoermann_door/light_component.h index 793ec4b..954abdd 100644 --- a/external_components/hoermann_door/light_component.h +++ b/external_components/hoermann_door/light_component.h @@ -59,7 +59,7 @@ class NbsLightOutput: public output::BinaryOutput, public Component{ } void set_state_callback(light::LightState *callback){ - if(callback == nullptr) ESP_LOGW(COMP_TAG, "Got Nullable callback"); + if(callback == nullptr) ESP_LOGW(TAG, "Got Nullable callback"); this->callback = callback; } void set_emulator_component(HoermannMainComponent* component){ @@ -72,14 +72,14 @@ class NbsLightOutput: public output::BinaryOutput, public Component{ //ESP_LOGD("Test", "I have no idea"); lastState = mainComponent->getEmulator()->getState().lampOn; if(lastState == true){ - ESP_LOGD(COMP_TAG, "Light State ON"); + ESP_LOGD(TAG, "Light State ON"); auto call = callback->make_call(); call.set_state(true); call.perform(); } else { - ESP_LOGD(COMP_TAG, "Light State OFF"); + ESP_LOGD(TAG, "Light State OFF"); auto call = callback->make_call(); call.set_state(false); call.perform(); diff --git a/garage1.yaml b/garage1.yaml index 8d2467e..504c667 100644 --- a/garage1.yaml +++ b/garage1.yaml @@ -1,5 +1,5 @@ substitutions: - garageSide: sy # sy, wo + garageSide: wo # sy, wo version: "2.1.3" esphome: @@ -30,6 +30,7 @@ wifi: ssid: !secret wifi_ssid password: !secret wifi_password fast_connect: true + min_auth_mode: WPA2 logger: #level: VERY_VERBOSE