diff --git a/components/ratgdo/__init__.py b/components/ratgdo/__init__.py index 32112ec..30d682c 100644 --- a/components/ratgdo/__init__.py +++ b/components/ratgdo/__init__.py @@ -142,12 +142,6 @@ async def to_code(config): repository="https://github.com/ratgdo/secplus#f98c3220356c27717a25102c0b35815ebbd26ccc", version=None, ) - if CORE.is_esp8266: - cg.add_library( - name="espsoftwareserial", - repository="https://github.com/ratgdo/espsoftwareserial#autobaud", - version=None, - ) cg.add_define("PROTOCOL_SECPLUSV2") cg.add(var.init_protocol()) diff --git a/components/ratgdo/macros.h b/components/ratgdo/macros.h index 54bb25a..e948dac 100644 --- a/components/ratgdo/macros.h +++ b/components/ratgdo/macros.h @@ -28,15 +28,9 @@ #define LPAREN ( -#ifdef USE_ESP8266 -#define TO_STRING_IF0(type, name, val) \ - if (_e == type::name) \ - return LOG_STR(#name); -#else #define TO_STRING_IF0(type, name, val) \ if (_e == type::name) \ return #name; -#endif #define TO_STRING_IF(type, tuple) TO_STRING_IF0 LPAREN type, TUPLE tuple) #define FROM_INT_CASE0(type, name, val) \ @@ -77,17 +71,10 @@ namespace detail { } // namespace esphome::ratgdo // Platform-specific helpers for enum string return types -#ifdef USE_ESP8266 -#define ENUM_STR_RET const esphome::LogString* -#define ENUM_STR_UNKNOWN LOG_STR("UNKNOWN") -#define ENUM_BLOB_ATTR PROGMEM -#define ENUM_BLOB_RETURN(blob, offset) reinterpret_cast(&(blob)[offset]) -#else #define ENUM_STR_RET const char* #define ENUM_STR_UNKNOWN "UNKNOWN" #define ENUM_BLOB_ATTR #define ENUM_BLOB_RETURN(blob, offset) (&(blob)[offset]) -#endif // ENUM: packed string blob with O(1) offset lookup (for contiguous 0-based enums with uint8_t type) #define ENUM(name, type, ...) \ diff --git a/components/ratgdo/number/__init__.py b/components/ratgdo/number/__init__.py index 762b45b..ca3f5c2 100644 --- a/components/ratgdo/number/__init__.py +++ b/components/ratgdo/number/__init__.py @@ -19,7 +19,6 @@ TYPES = { "rolling_code_counter": NumberType.RATGDO_ROLLING_CODE_COUNTER, "opening_duration": NumberType.RATGDO_OPENING_DURATION, "closing_duration": NumberType.RATGDO_CLOSING_DURATION, - "closing_delay": NumberType.RATGDO_CLOSING_DELAY, "target_distance_measurement": NumberType.RATGDO_TARGET_DISTANCE_MEASUREMENT, } @@ -51,8 +50,3 @@ async def to_code(config): await cg.register_component(var, config) cg.add(var.set_number_type(config[CONF_TYPE])) await register_ratgdo_child(var, config) - - # Add defines for enabled features - # sensor will add the define for the distance sensor - if config[CONF_TYPE] == "closing_delay": - cg.add_define("RATGDO_USE_CLOSING_DELAY") diff --git a/components/ratgdo/number/ratgdo_number.cpp b/components/ratgdo/number/ratgdo_number.cpp index 058f124..2d794f7 100644 --- a/components/ratgdo/number/ratgdo_number.cpp +++ b/components/ratgdo/number/ratgdo_number.cpp @@ -34,11 +34,6 @@ void RATGDONumber::dump_config() case RATGDO_CLOSING_DURATION: ESP_LOGCONFIG(TAG, " Type: Closing Duration"); break; -#ifdef RATGDO_USE_CLOSING_DELAY - case RATGDO_CLOSING_DELAY: - ESP_LOGCONFIG(TAG, " Type: Closing Delay"); - break; -#endif #ifdef RATGDO_USE_DISTANCE_SENSOR case RATGDO_TARGET_DISTANCE_MEASUREMENT: ESP_LOGCONFIG(TAG, " Type: Target Distance Measurement"); @@ -86,13 +81,6 @@ void RATGDONumber::setup() this->update_state(value); }); break; -#ifdef RATGDO_USE_CLOSING_DELAY - case RATGDO_CLOSING_DELAY: - this->parent_->subscribe_closing_delay([this](uint32_t value) { - this->update_state(value); - }); - break; -#endif #ifdef RATGDO_USE_DISTANCE_SENSOR case RATGDO_TARGET_DISTANCE_MEASUREMENT: // this->parent_->subscribe_target_distance_measurement([=](float value) { @@ -115,13 +103,6 @@ void RATGDONumber::set_number_type(NumberType number_type_) this->traits.set_min_value(0.0); this->traits.set_max_value(180.0); break; -#ifdef RATGDO_USE_CLOSING_DELAY - case RATGDO_CLOSING_DELAY: - this->traits.set_step(1); - this->traits.set_min_value(0.0); - this->traits.set_max_value(60.0); - break; -#endif case RATGDO_ROLLING_CODE_COUNTER: this->traits.set_max_value(0xfffffff); break; @@ -163,11 +144,6 @@ void RATGDONumber::control(float value) case RATGDO_CLOSING_DURATION: this->parent_->set_closing_duration(value); break; -#ifdef RATGDO_USE_CLOSING_DELAY - case RATGDO_CLOSING_DELAY: - this->parent_->set_closing_delay(value); - break; -#endif case RATGDO_CLIENT_ID: value = normalize_client_id(value); this->parent_->call_protocol(SetClientID { static_cast(value) }); diff --git a/components/ratgdo/number/ratgdo_number.h b/components/ratgdo/number/ratgdo_number.h index be9e5a4..1eab932 100644 --- a/components/ratgdo/number/ratgdo_number.h +++ b/components/ratgdo/number/ratgdo_number.h @@ -13,9 +13,6 @@ enum NumberType { RATGDO_ROLLING_CODE_COUNTER, RATGDO_OPENING_DURATION, RATGDO_CLOSING_DURATION, -#ifdef RATGDO_USE_CLOSING_DELAY - RATGDO_CLOSING_DELAY, -#endif #ifdef RATGDO_USE_DISTANCE_SENSOR RATGDO_TARGET_DISTANCE_MEASUREMENT, #endif diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 449b553..fbba48c 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -379,19 +379,7 @@ void RATGDOComponent::door_toggle() { this->door_action(DoorAction::TOGGLE); } void RATGDOComponent::door_action(DoorAction action) { -#ifdef RATGDO_USE_CLOSING_DELAY - if (*this->closing_delay > 0 && (action == DoorAction::CLOSE || (action == DoorAction::TOGGLE && *this->door_state != DoorState::CLOSED))) { - this->door_action_delayed = DoorActionDelayed::YES; - this->set_timeout(TIMEOUT_DOOR_ACTION, *this->closing_delay * 1000, [this] { - this->door_action_delayed = DoorActionDelayed::NO; - this->protocol_->door_action(DoorAction::CLOSE); - }); - } else { - this->protocol_->door_action(action); - } -#else this->protocol_->door_action(action); -#endif } void RATGDOComponent::door_move_to_position(float position) diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index dfecefd..3af528c 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -72,9 +72,6 @@ public: single_observable opening_duration { 0 }; float start_closing { -1 }; single_observable closing_duration { 0 }; -#ifdef RATGDO_USE_CLOSING_DELAY - single_observable closing_delay { 0 }; -#endif #ifdef RATGDO_USE_DISTANCE_SENSOR single_observable target_distance_measurement { -1 }; @@ -122,9 +119,6 @@ public: void set_door_position(float door_position) { this->door_position = door_position; } void set_opening_duration(float duration); void set_closing_duration(float duration); -#ifdef RATGDO_USE_CLOSING_DELAY - void set_closing_delay(uint32_t delay) { this->closing_delay = delay; } -#endif void schedule_door_position_sync(float update_period = 500); void door_position_update(); void cancel_position_sync_callbacks(); @@ -198,10 +192,6 @@ public: void subscribe_opening_duration(F&& f); template void subscribe_closing_duration(F&& f); -#ifdef RATGDO_USE_CLOSING_DELAY - template - void subscribe_closing_delay(F&& f); -#endif template void subscribe_openings(F&& f); template @@ -278,7 +268,6 @@ namespace scheduler_ids { DEFER_ROLLING_CODE = DEFER_DISTANCE_END, DEFER_OPENING_DURATION, DEFER_CLOSING_DURATION, - DEFER_CLOSING_DELAY, DEFER_OPENINGS, DEFER_LIGHT_STATE, DEFER_LOCK_STATE, @@ -326,16 +315,6 @@ void RATGDOComponent::subscribe_closing_duration(F&& f) }); } -#ifdef RATGDO_USE_CLOSING_DELAY -template -void RATGDOComponent::subscribe_closing_delay(F&& f) -{ - this->closing_delay.subscribe([this, f](uint32_t state) { - defer(scheduler_ids::DEFER_CLOSING_DELAY, [f, state] { f(state); }); - }); -} -#endif - template void RATGDOComponent::subscribe_openings(F&& f) { diff --git a/components/ratgdo/ratgdo_uart.h b/components/ratgdo/ratgdo_uart.h index 71b1e52..73d6bf6 100644 --- a/components/ratgdo/ratgdo_uart.h +++ b/components/ratgdo/ratgdo_uart.h @@ -1,9 +1,4 @@ #pragma once #include "esphome/core/defines.h" - -#ifdef USE_ESP32 #include "ratgdo_uart_esp32.h" -#elif defined(USE_ESP8266) -#include "ratgdo_uart_esp8266.h" -#endif diff --git a/garage-gate.yaml b/garage-gate.yaml index 5d24969..4a2b62c 100644 --- a/garage-gate.yaml +++ b/garage-gate.yaml @@ -5,7 +5,6 @@ web_server: esphome: name: garage-gate friendly_name: "Garage Gate" - name_add_mac_suffix: true min_version: 2026.2.0 project: name: ratgdo.v32disco_secplus2 @@ -128,12 +127,6 @@ number: entity_category: config name: "Client ID" mode: box - - platform: ratgdo - id: garage_gate_closing_delay - type: closing_delay - entity_category: config - name: "Closing Delay" - unit_of_measurement: "s" cover: - platform: ratgdo