mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Unify 'nullptr' initalization of class members; (#3805)
This commit is contained in:
parent
aaf50fc2e6
commit
78b55d86e9
10 changed files with 16 additions and 16 deletions
|
@ -82,7 +82,7 @@ class ADE7953 : public i2c::I2CDevice, public PollingComponent {
|
||||||
return i2c::ERROR_OK;
|
return i2c::ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalGPIOPin *irq_pin_ = nullptr;
|
InternalGPIOPin *irq_pin_{nullptr};
|
||||||
bool is_setup_{false};
|
bool is_setup_{false};
|
||||||
sensor::Sensor *voltage_sensor_{nullptr};
|
sensor::Sensor *voltage_sensor_{nullptr};
|
||||||
sensor::Sensor *current_a_sensor_{nullptr};
|
sensor::Sensor *current_a_sensor_{nullptr};
|
||||||
|
|
|
@ -116,9 +116,9 @@ class APINoiseFrameHelper : public APIFrameHelper {
|
||||||
std::vector<uint8_t> prologue_;
|
std::vector<uint8_t> prologue_;
|
||||||
|
|
||||||
std::shared_ptr<APINoiseContext> ctx_;
|
std::shared_ptr<APINoiseContext> ctx_;
|
||||||
NoiseHandshakeState *handshake_ = nullptr;
|
NoiseHandshakeState *handshake_{nullptr};
|
||||||
NoiseCipherState *send_cipher_ = nullptr;
|
NoiseCipherState *send_cipher_{nullptr};
|
||||||
NoiseCipherState *recv_cipher_ = nullptr;
|
NoiseCipherState *recv_cipher_{nullptr};
|
||||||
NoiseProtocolId nid_;
|
NoiseProtocolId nid_;
|
||||||
|
|
||||||
enum class State {
|
enum class State {
|
||||||
|
|
|
@ -58,9 +58,9 @@ class HydreonRGxxComponent : public PollingComponent, public uart::UARTDevice {
|
||||||
|
|
||||||
sensor::Sensor *sensors_[NUM_SENSORS] = {nullptr};
|
sensor::Sensor *sensors_[NUM_SENSORS] = {nullptr};
|
||||||
#ifdef USE_BINARY_SENSOR
|
#ifdef USE_BINARY_SENSOR
|
||||||
binary_sensor::BinarySensor *too_cold_sensor_ = nullptr;
|
binary_sensor::BinarySensor *too_cold_sensor_{nullptr};
|
||||||
binary_sensor::BinarySensor *lens_bad_sensor_ = nullptr;
|
binary_sensor::BinarySensor *lens_bad_sensor_{nullptr};
|
||||||
binary_sensor::BinarySensor *em_sat_sensor_ = nullptr;
|
binary_sensor::BinarySensor *em_sat_sensor_{nullptr};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int16_t boot_count_ = 0;
|
int16_t boot_count_ = 0;
|
||||||
|
|
|
@ -52,7 +52,7 @@ class MLX90393Cls : public PollingComponent, public i2c::I2CDevice, public MLX90
|
||||||
uint8_t temperature_oversampling_ = 0;
|
uint8_t temperature_oversampling_ = 0;
|
||||||
uint8_t filter_;
|
uint8_t filter_;
|
||||||
uint8_t resolutions_[3] = {0};
|
uint8_t resolutions_[3] = {0};
|
||||||
GPIOPin *drdy_pin_ = nullptr;
|
GPIOPin *drdy_pin_{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mlx90393
|
} // namespace mlx90393
|
||||||
|
|
|
@ -59,8 +59,8 @@ class PIDClimate : public climate::Climate, public Component {
|
||||||
|
|
||||||
/// The sensor used for getting the current temperature
|
/// The sensor used for getting the current temperature
|
||||||
sensor::Sensor *sensor_;
|
sensor::Sensor *sensor_;
|
||||||
output::FloatOutput *cool_output_ = nullptr;
|
output::FloatOutput *cool_output_{nullptr};
|
||||||
output::FloatOutput *heat_output_ = nullptr;
|
output::FloatOutput *heat_output_{nullptr};
|
||||||
PIDController controller_;
|
PIDController controller_;
|
||||||
/// Output value as reported by the PID controller, for PIDClimateSensor
|
/// Output value as reported by the PID controller, for PIDClimateSensor
|
||||||
float output_value_;
|
float output_value_;
|
||||||
|
|
|
@ -31,11 +31,11 @@ class PulseMeterSensor : public sensor::Sensor, public Component {
|
||||||
protected:
|
protected:
|
||||||
static void gpio_intr(PulseMeterSensor *sensor);
|
static void gpio_intr(PulseMeterSensor *sensor);
|
||||||
|
|
||||||
InternalGPIOPin *pin_ = nullptr;
|
InternalGPIOPin *pin_{nullptr};
|
||||||
ISRInternalGPIOPin isr_pin_;
|
ISRInternalGPIOPin isr_pin_;
|
||||||
uint32_t filter_us_ = 0;
|
uint32_t filter_us_ = 0;
|
||||||
uint32_t timeout_us_ = 1000000UL * 60UL * 5UL;
|
uint32_t timeout_us_ = 1000000UL * 60UL * 5UL;
|
||||||
sensor::Sensor *total_sensor_ = nullptr;
|
sensor::Sensor *total_sensor_{nullptr};
|
||||||
InternalFilterMode filter_mode_{FILTER_EDGE};
|
InternalFilterMode filter_mode_{FILTER_EDGE};
|
||||||
|
|
||||||
Deduplicator<uint32_t> pulse_width_dedupe_;
|
Deduplicator<uint32_t> pulse_width_dedupe_;
|
||||||
|
|
|
@ -114,7 +114,7 @@ class PVVXDisplay : public ble_client::BLEClientNode, public PollingComponent {
|
||||||
void delayed_disconnect_();
|
void delayed_disconnect_();
|
||||||
#ifdef USE_TIME
|
#ifdef USE_TIME
|
||||||
void sync_time_();
|
void sync_time_();
|
||||||
time::RealTimeClock *time_ = nullptr;
|
time::RealTimeClock *time_{nullptr};
|
||||||
#endif
|
#endif
|
||||||
uint16_t char_handle_ = 0;
|
uint16_t char_handle_ = 0;
|
||||||
bool connection_established_ = false;
|
bool connection_established_ = false;
|
||||||
|
|
|
@ -176,7 +176,7 @@ template<typename... Ts> class Action {
|
||||||
return this->next_->is_running();
|
return this->next_->is_running();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action<Ts...> *next_ = nullptr;
|
Action<Ts...> *next_{nullptr};
|
||||||
|
|
||||||
/// The number of instances of this sequence in the list of actions
|
/// The number of instances of this sequence in the list of actions
|
||||||
/// that is currently being executed.
|
/// that is currently being executed.
|
||||||
|
|
|
@ -254,7 +254,7 @@ class Component {
|
||||||
|
|
||||||
uint32_t component_state_{0x0000}; ///< State of this component.
|
uint32_t component_state_{0x0000}; ///< State of this component.
|
||||||
float setup_priority_override_{NAN};
|
float setup_priority_override_{NAN};
|
||||||
const char *component_source_ = nullptr;
|
const char *component_source_{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class simplifies creating components that periodically check a state.
|
/** This class simplifies creating components that periodically check a state.
|
||||||
|
|
|
@ -73,7 +73,7 @@ class ISRInternalGPIOPin {
|
||||||
void pin_mode(gpio::Flags flags);
|
void pin_mode(gpio::Flags flags);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void *arg_ = nullptr;
|
void *arg_{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
class InternalGPIOPin : public GPIOPin {
|
class InternalGPIOPin : public GPIOPin {
|
||||||
|
|
Loading…
Reference in a new issue