Updated Hörmann_door to completely use namespaces. Makes code a bit cleaner

This commit is contained in:
2025-10-07 00:50:49 +02:00
parent 3ef68a9539
commit 9d3930af59
6 changed files with 48 additions and 37 deletions

View File

@@ -13,8 +13,6 @@ class NbsLightManager;
#define TX_ON 25
//#define configMAX_PRIORITIES 25
#define TAG "hoermann_door"
namespace esphome {
namespace hoermann_door {
@@ -61,7 +59,7 @@ class NbsLightOutput: public output::BinaryOutput, public Component{
}
void set_state_callback(light::LightState *callback){
if(callback == nullptr) ESP_LOGW("Hoermann_door(Light)", "Got Nullable callback");
if(callback == nullptr) ESP_LOGW(COMP_TAG, "Got Nullable callback");
this->callback = callback;
}
void set_emulator_component(HoermannMainComponent* component){
@@ -74,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(TAG, "Hoermann_door(Light)", "Light State ON");
ESP_LOGD(COMP_TAG, "Light State ON");
auto call = callback->make_call();
call.set_state(true);
call.perform();
}
else {
ESP_LOGD(TAG, "Hoermann_door(Light)", "Light State OFF");
ESP_LOGD(COMP_TAG, "Light State OFF");
auto call = callback->make_call();
call.set_state(false);
call.perform();