codestyle

This commit is contained in:
Guido Schreuder 2024-03-10 21:22:19 +01:00
parent 5c77d71d2c
commit c4031bef74
2 changed files with 3 additions and 5 deletions

View file

@ -128,7 +128,7 @@ async def to_code(config):
def item_config(ebus, item, config): def item_config(ebus, item, config):
cg.add(item.set_parent(ebus)) cg.add(item.set_parent(ebus))
cg.add(ebus.add_item(item)), cg.add(ebus.add_item(item))
cg.add(item.set_send_poll(config[CONF_TELEGRAM][CONF_SEND_POLL])) cg.add(item.set_send_poll(config[CONF_TELEGRAM][CONF_SEND_POLL]))
if CONF_ADDRESS in config[CONF_TELEGRAM]: if CONF_ADDRESS in config[CONF_TELEGRAM]:
cg.add(item.set_address(config[CONF_TELEGRAM][CONF_ADDRESS])) cg.add(item.set_address(config[CONF_TELEGRAM][CONF_ADDRESS]))

View file

@ -31,7 +31,7 @@ class EbusItem : public Component {
void set_payload(const std::vector<uint8_t> &payload) { this->payload_ = payload; } void set_payload(const std::vector<uint8_t> &payload) { this->payload_ = payload; }
void set_response_read_position(uint8_t response_position) { this->response_position_ = response_position; } void set_response_read_position(uint8_t response_position) { this->response_position_ = response_position; }
virtual void process_received(Telegram) { } virtual void process_received(Telegram) {}
virtual std::vector<uint8_t> reply(Telegram telegram) { virtual std::vector<uint8_t> reply(Telegram telegram) {
std::vector<uint8_t> reply = {0xe3, 'E', 'S', 'P', 'H', 'M', 0x12, 0x34, 0x56, 0x78}; std::vector<uint8_t> reply = {0xe3, 'E', 'S', 'P', 'H', 'M', 0x12, 0x34, 0x56, 0x78};
return reply; return reply;
@ -68,9 +68,7 @@ class EbusComponent : public PollingComponent {
void set_history_queue_size(uint8_t /*history_queue_size*/); void set_history_queue_size(uint8_t /*history_queue_size*/);
void set_command_queue_size(uint8_t /*command_queue_size*/); void set_command_queue_size(uint8_t /*command_queue_size*/);
void add_item(EbusItem *item) { void add_item(EbusItem *item) { this->items_.push_back(item); };
this->items_.push_back(item);
};
void update() override; void update() override;