10 namespace selec_meter {
12 #define SELEC_METER_SENSOR(name) \ 14 sensor::Sensor *name##_sensor_{nullptr}; \ 17 void set_##name##_sensor(sensor::Sensor *(name)) { this->name##_sensor_ = name; }
void on_modbus_data(const std::vector< uint8_t > &data) override
This class simplifies creating components that periodically check a state.
void dump_config() override
Implementation of SPI Controller mode.
SELEC_METER_SENSOR(total_active_energy) SELEC_METER_SENSOR(import_active_energy) SELEC_METER_SENSOR(export_active_energy) SELEC_METER_SENSOR(total_reactive_energy) SELEC_METER_SENSOR(import_reactive_energy) SELEC_METER_SENSOR(export_reactive_energy) SELEC_METER_SENSOR(apparent_energy) SELEC_METER_SENSOR(active_power) SELEC_METER_SENSOR(reactive_power) SELEC_METER_SENSOR(apparent_power) SELEC_METER_SENSOR(voltage) SELEC_METER_SENSOR(current) SELEC_METER_SENSOR(power_factor) SELEC_METER_SENSOR(frequency) SELEC_METER_SENSOR(maximum_demand_active_power) SELEC_METER_SENSOR(maximum_demand_reactive_power) SELEC_METER_SENSOR(maximum_demand_apparent_power) void update() override