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
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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<typename... Ts> class StopPollingAction: public Action<Ts...> {
|
||||
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<typename... Ts> class StartPollingAction: public Action<Ts...> {
|
||||
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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user