|
ESPHome 2026.11.0b6
|
#include <modbus_output.h>
Public Types | |
| using | write_transform_func_t = optional<bool> (*)(ModbusBinaryOutput *, bool, modbus::helpers::PduBuffer &) |
Public Member Functions | |
| ModbusBinaryOutput (uint16_t start_address, uint8_t offset) | |
| void | set_parent (ModbusController *parent) |
| void | parse_and_publish (std::span< const uint8_t > data) override |
| void | set_write_template (write_transform_func_t f) |
| void | set_use_write_mutiple (bool use_write_multiple) |
Public Member Functions inherited from esphome::output::BinaryOutput | |
| void | set_inverted (bool inverted) |
| Set the inversion state of this binary output. | |
| void | set_power_supply (power_supply::PowerSupply *power_supply) |
| Use this to connect up a power supply to this output. | |
| virtual void | set_state (bool state) |
| Enable or disable this binary output. | |
| virtual void | turn_on () |
| Enable this binary output. | |
| virtual void | turn_off () |
| Disable this binary output. | |
| bool | is_inverted () const |
| Return whether this binary output is inverted. | |
Public Member Functions inherited from esphome::modbus_controller::SensorItem | |
| bool | addresses_bits () const |
| Coils and discrete inputs address individual bits; every other type addresses 16-bit registers. | |
| uint16_t | write_address () const |
| Address a write entity (switch/number/select) targets, derived from its resolved position within the range so that a write lands on the register the sensor reads from. | |
| void | set_offset_from_start_address (uint8_t offset) |
| Records the offset as configured, and seeds the resolved position with it. | |
| void | set_address (uint16_t address) |
| Sets the configured address, and points the range base at it. | |
| void | set_custom_pdu (std::initializer_list< uint8_t > pdu) |
| virtual uint16_t | entity_count () const |
| Entities this item spans: one bit for bit-addressed types, ceil(bytes / 2) registers for RAW with a response_size, else the value type's register width. | |
| virtual size_t | get_register_size () const |
| Bytes this item's registers occupy in a response: one per bit for bit-addressed types; response_size when set (devices that answer more bytes per register than the standard two); else two per register. | |
| void | set_register_size (uint8_t register_size) |
Public Member Functions inherited from esphome::modbus_controller::WriterEntity | |
| bool | dispatched () const |
| Whether the lambda called a request helper since the last clear_dispatched_(). | |
| void | set_write_options (modbus::CommandOptions options) |
| bool | write_single_register (uint16_t address, uint16_t value) |
| bool | write_single_coil (uint16_t address, bool value) |
| bool | write_multiple_registers (uint16_t address, std::span< const uint16_t > values) |
| bool | write_multiple_coils (uint16_t address, std::span< const bool > values) |
| bool | write_multiple_coils (uint16_t address, modbus::PackedBits bits) |
| bool | queue_pdu (std::span< const uint8_t > pdu) |
| bool | queue_pdu (std::span< const uint8_t > pdu, modbus::CommandOptions options) |
| void | clear_tx_queue_for_device () |
Protected Member Functions | |
| void | write_state (bool state) override |
Protected Member Functions inherited from esphome::output::BinaryOutput | |
Protected Member Functions inherited from esphome::modbus_controller::WriterEntity | |
| bool | send_raw_frame_deprecated_ (std::span< const uint8_t > frame) |
| void | set_controller_ (ModbusController *controller) |
| void | clear_dispatched_ () |
| void | warn_write_buffer_deprecated_ (const LogString *platform, uint16_t address) |
Protected Attributes | |
| optional< write_transform_func_t > | write_transform_func_ {nullopt} |
| bool | use_write_multiple_ {false} |
Protected Attributes inherited from esphome::output::BinaryOutput | |
| bool | inverted_ {false} |
| power_supply::PowerSupplyRequester | power_ {} |
Additional Inherited Members | |
Data Fields inherited from esphome::modbus_controller::SensorItem | |
| modbus::EntityType | register_type {modbus::EntityType::CUSTOM} |
| SensorValueType | sensor_value_type {SensorValueType::RAW} |
| uint16_t | start_address {0} |
| uint32_t | bitmask {0} |
| uint8_t | offset {0} |
| Position of this sensor's data within its range's response - a byte offset for registers, a bit index for coils and discrete inputs. | |
| uint8_t | response_bytes {0} |
| uint8_t | offset_from_start_address {0} |
The offset exactly as configured: measured from this sensor's own start_address, where offset is measured from the first register of the range it ends up polled in. | |
| uint16_t | range_start_address {0} |
| First register of the range this sensor is polled in; equals start_address for an unpolled item. | |
| SmallInlineBuffer< 8 > | custom_pdu {} |
| RangeReuse | reuse_previous_range {RangeReuse::AUTO} |
Definition at line 38 of file modbus_output.h.
| using esphome::modbus_controller::ModbusBinaryOutput::write_transform_func_t = optional<bool> (*)(ModbusBinaryOutput *, bool, modbus::helpers::PduBuffer &) |
Definition at line 53 of file modbus_output.h.
|
inline |
Definition at line 40 of file modbus_output.h.
|
inlineoverridevirtual |
Implements esphome::modbus_controller::SensorItem.
Definition at line 51 of file modbus_output.h.
|
inline |
Definition at line 49 of file modbus_output.h.
|
inline |
Definition at line 55 of file modbus_output.h.
|
inline |
Definition at line 54 of file modbus_output.h.
|
overrideprotectedvirtual |
Implements esphome::output::BinaryOutput.
Definition at line 77 of file modbus_output.cpp.
|
protected |
Definition at line 61 of file modbus_output.h.
|
protected |
Definition at line 59 of file modbus_output.h.