28 void setup()
override;
void parse_and_publish(std::span< const uint8_t > data) override
ModbusSwitch(modbus::EntityType register_type, uint16_t start_address, uint8_t offset, uint32_t bitmask, uint16_t skip_updates, bool force_new_range)
void set_use_write_mutiple(bool use_write_multiple)
void set_state(bool state)
optional< bool >(*)(ModbusSwitch *, bool, std::vector< uint8_t > &) write_transform_func_t
optional< write_transform_func_t > write_transform_func_
bool assumed_state() override
void set_assumed_state(bool assumed_state)
void set_parent(ModbusController *parent)
ModbusController * parent_
void set_write_template(write_transform_func_t f)
void write_state(bool state) override
void dump_config() override
optional< bool >(*)(ModbusSwitch *, bool, std::span< const uint8_t >) transform_func_t
optional< transform_func_t > publish_transform_func_
void set_template(transform_func_t f)
modbus::EntityType register_type
void set_address(uint16_t address)
Sets the configured address, and points the range base at it.
void set_offset_from_start_address(uint8_t offset)
Records the offset as configured, and seeds the resolved position with it.
SensorValueType sensor_value_type
uint8_t offset
Position of this sensor's data within its range's response - a byte offset for registers,...
Base class for all switches.
bool state
The current reported state of the binary sensor.
const std::vector< uint8_t > & data