1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 05:03:48 +00:00

Enable readability-redundant-member-init check (#3097)

This commit is contained in:
Oxan van Leeuwen
2022-01-23 08:34:43 +01:00
committed by GitHub
parent a31700e16f
commit 7da12a878f
22 changed files with 22 additions and 30 deletions

View File

@@ -10,8 +10,7 @@ namespace modbus_controller {
class ModbusBinarySensor : public Component, public binary_sensor::BinarySensor, public SensorItem {
public:
ModbusBinarySensor(ModbusRegisterType register_type, uint16_t start_address, uint8_t offset, uint32_t bitmask,
uint8_t skip_updates, bool force_new_range)
: Component(), binary_sensor::BinarySensor() {
uint8_t skip_updates, bool force_new_range) {
this->register_type = register_type;
this->start_address = start_address;
this->offset = offset;

View File

@@ -393,7 +393,7 @@ class ModbusCommandItem {
class ModbusController : public PollingComponent, public modbus::ModbusDevice {
public:
ModbusController(uint16_t throttle = 0) : modbus::ModbusDevice(), command_throttle_(throttle){};
ModbusController(uint16_t throttle = 0) : command_throttle_(throttle){};
void dump_config() override;
void loop() override;
void setup() override;

View File

@@ -12,8 +12,7 @@ using value_to_data_t = std::function<float>(float);
class ModbusNumber : public number::Number, public Component, public SensorItem {
public:
ModbusNumber(uint16_t start_address, uint8_t offset, uint32_t bitmask, SensorValueType value_type, int register_count,
uint8_t skip_updates, bool force_new_range)
: number::Number(), Component(), SensorItem() {
uint8_t skip_updates, bool force_new_range) {
this->register_type = ModbusRegisterType::HOLDING;
this->start_address = start_address;
this->offset = offset;

View File

@@ -9,8 +9,7 @@ namespace modbus_controller {
class ModbusFloatOutput : public output::FloatOutput, public Component, public SensorItem {
public:
ModbusFloatOutput(uint16_t start_address, uint8_t offset, SensorValueType value_type, int register_count)
: output::FloatOutput(), Component() {
ModbusFloatOutput(uint16_t start_address, uint8_t offset, SensorValueType value_type, int register_count) {
this->register_type = ModbusRegisterType::HOLDING;
this->start_address = start_address;
this->offset = offset;
@@ -43,7 +42,7 @@ class ModbusFloatOutput : public output::FloatOutput, public Component, public S
class ModbusBinaryOutput : public output::BinaryOutput, public Component, public SensorItem {
public:
ModbusBinaryOutput(uint16_t start_address, uint8_t offset) : output::BinaryOutput(), Component() {
ModbusBinaryOutput(uint16_t start_address, uint8_t offset) {
this->register_type = ModbusRegisterType::COIL;
this->start_address = start_address;
this->bitmask = bitmask;

View File

@@ -10,8 +10,7 @@ namespace modbus_controller {
class ModbusSensor : public Component, public sensor::Sensor, public SensorItem {
public:
ModbusSensor(ModbusRegisterType register_type, uint16_t start_address, uint8_t offset, uint32_t bitmask,
SensorValueType value_type, int register_count, uint8_t skip_updates, bool force_new_range)
: Component(), sensor::Sensor() {
SensorValueType value_type, int register_count, uint8_t skip_updates, bool force_new_range) {
this->register_type = register_type;
this->start_address = start_address;
this->offset = offset;

View File

@@ -10,8 +10,7 @@ namespace modbus_controller {
class ModbusSwitch : public Component, public switch_::Switch, public SensorItem {
public:
ModbusSwitch(ModbusRegisterType register_type, uint16_t start_address, uint8_t offset, uint32_t bitmask,
uint8_t skip_updates, bool force_new_range)
: Component(), switch_::Switch() {
uint8_t skip_updates, bool force_new_range) {
this->register_type = register_type;
this->start_address = start_address;
this->offset = offset;

View File

@@ -12,8 +12,7 @@ enum class RawEncoding { NONE = 0, HEXBYTES = 1, COMMA = 2 };
class ModbusTextSensor : public Component, public text_sensor::TextSensor, public SensorItem {
public:
ModbusTextSensor(ModbusRegisterType register_type, uint16_t start_address, uint8_t offset, uint8_t register_count,
uint16_t response_bytes, RawEncoding encode, uint8_t skip_updates, bool force_new_range)
: Component() {
uint16_t response_bytes, RawEncoding encode, uint8_t skip_updates, bool force_new_range) {
this->register_type = register_type;
this->start_address = start_address;
this->offset = offset;