10 namespace modbus_controller {
24 this->start_address +=
offset;
29 void setup()
override;
Base class for all switches.
SensorValueType sensor_value_type
ModbusController * parent_
void set_template(transform_func_t &&f)
optional< write_transform_func_t > write_transform_func_
optional< transform_func_t > publish_transform_func_
ModbusRegisterType register_type
void set_parent(ModbusController *parent)
std::function< optional< bool >(ModbusSwitch *, bool, const std::vector< uint8_t > &)> transform_func_t
const nullopt_t nullopt((nullopt_t::init()))
ModbusSwitch(ModbusRegisterType register_type, uint16_t start_address, uint8_t offset, uint32_t bitmask, uint16_t skip_updates, bool force_new_range)
void set_state(bool state)
void parse_and_publish(const std::vector< uint8_t > &data) override
std::function< optional< bool >(ModbusSwitch *, bool, std::vector< uint8_t > &)> write_transform_func_t
void set_write_template(write_transform_func_t &&f)
void dump_config() override
Implementation of SPI Controller mode.
void set_use_write_mutiple(bool use_write_multiple)
bool state
The current reported state of the binary sensor.
void write_state(bool state) override