mirror of
https://github.com/esphome/esphome.git
synced 2025-10-26 12:43:48 +00:00
FIX: Unnecessary flash writes by ModbusSwitch component (#3648)
This commit is contained in:
@@ -32,7 +32,7 @@ ModbusSwitch = modbus_controller_ns.class_(
|
||||
)
|
||||
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
switch.switch_schema(ModbusSwitch)
|
||||
switch.switch_schema(ModbusSwitch, default_restore_mode="DISABLED")
|
||||
.extend(cv.COMPONENT_SCHEMA)
|
||||
.extend(ModbusItemBaseSchema)
|
||||
.extend(
|
||||
|
||||
@@ -6,11 +6,7 @@ namespace modbus_controller {
|
||||
|
||||
static const char *const TAG = "modbus_controller.switch";
|
||||
|
||||
void ModbusSwitch::setup() {
|
||||
// value isn't required
|
||||
// without it we crash on save
|
||||
this->get_initial_state();
|
||||
}
|
||||
void ModbusSwitch::setup() {}
|
||||
void ModbusSwitch::dump_config() { LOG_SWITCH(TAG, "Modbus Controller Switch", this); }
|
||||
|
||||
void ModbusSwitch::parse_and_publish(const std::vector<uint8_t> &data) {
|
||||
|
||||
Reference in New Issue
Block a user