Merge pull request #101 from sprocketstech/master

Use fully qualified names in header
This commit is contained in:
Geoff Davis 2023-06-15 16:52:41 -07:00 committed by GitHub
commit edbf25f4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 18 deletions

View File

@ -53,6 +53,11 @@ void MitsubishiHeatPump::check_logger_conflict_() {
#endif #endif
} }
void MitsubishiHeatPump::banner() {
ESP_LOGI(TAG, "ESPHome MitsubishiHeatPump version %s",
ESPMHP_VERSION);
}
void MitsubishiHeatPump::update() { void MitsubishiHeatPump::update() {
// This will be called every "update_interval" milliseconds. // This will be called every "update_interval" milliseconds.
//this->dump_config(); //this->dump_config();

View File

@ -21,7 +21,6 @@
#include "esphome/core/preferences.h" #include "esphome/core/preferences.h"
#include "HeatPump.h" #include "HeatPump.h"
using namespace esphome;
#ifndef ESPMHP_H #ifndef ESPMHP_H
#define ESPMHP_H #define ESPMHP_H
@ -41,7 +40,7 @@ static const uint8_t ESPMHP_MAX_TEMPERATURE = 31; // degrees C,
static const float ESPMHP_TEMPERATURE_STEP = 0.5; // temperature setting step, static const float ESPMHP_TEMPERATURE_STEP = 0.5; // temperature setting step,
// in degrees C // in degrees C
class MitsubishiHeatPump : public PollingComponent, public climate::Climate { class MitsubishiHeatPump : public esphome::PollingComponent, public esphome::climate::Climate {
public: public:
@ -58,10 +57,7 @@ class MitsubishiHeatPump : public PollingComponent, public climate::Climate {
); );
// Print a banner with library information. // Print a banner with library information.
void banner() { void banner();
ESP_LOGI(TAG, "ESPHome MitsubishiHeatPump version %s",
ESPMHP_VERSION);
}
// Set the baud rate. Must be called before setup() to have any effect. // Set the baud rate. Must be called before setup() to have any effect.
void set_baud_rate(int); void set_baud_rate(int);
@ -88,16 +84,16 @@ class MitsubishiHeatPump : public PollingComponent, public climate::Climate {
void update() override; void update() override;
// Configure the climate object with traits that we support. // Configure the climate object with traits that we support.
climate::ClimateTraits traits() override; esphome::climate::ClimateTraits traits() override;
// Get a mutable reference to the traits that we support. // Get a mutable reference to the traits that we support.
climate::ClimateTraits& config_traits(); esphome::climate::ClimateTraits& config_traits();
// Debugging function to print the object's state. // Debugging function to print the object's state.
void dump_state(); void dump_state();
// Handle a request from the user to change settings. // Handle a request from the user to change settings.
void control(const climate::ClimateCall &call) override; void control(const esphome::climate::ClimateCall &call) override;
// Use the temperature from an external sensor. Use // Use the temperature from an external sensor. Use
// set_remote_temp(0) to switch back to the internal sensor. // set_remote_temp(0) to switch back to the internal sensor.
@ -108,7 +104,7 @@ class MitsubishiHeatPump : public PollingComponent, public climate::Climate {
HeatPump* hp; HeatPump* hp;
// The ClimateTraits supported by this HeatPump. // The ClimateTraits supported by this HeatPump.
climate::ClimateTraits traits_; esphome::climate::ClimateTraits traits_;
// Allow the HeatPump class to use get_hw_serial_ // Allow the HeatPump class to use get_hw_serial_
friend class HeatPump; friend class HeatPump;
@ -124,16 +120,16 @@ class MitsubishiHeatPump : public PollingComponent, public climate::Climate {
// various prefs to save mode-specific temperatures, akin to how the IR // various prefs to save mode-specific temperatures, akin to how the IR
// remote works. // remote works.
ESPPreferenceObject cool_storage; esphome::ESPPreferenceObject cool_storage;
ESPPreferenceObject heat_storage; esphome::ESPPreferenceObject heat_storage;
ESPPreferenceObject auto_storage; esphome::ESPPreferenceObject auto_storage;
optional<float> cool_setpoint; esphome::optional<float> cool_setpoint;
optional<float> heat_setpoint; esphome::optional<float> heat_setpoint;
optional<float> auto_setpoint; esphome::optional<float> auto_setpoint;
static void save(float value, ESPPreferenceObject& storage); static void save(float value, esphome::ESPPreferenceObject& storage);
static optional<float> load(ESPPreferenceObject& storage); static esphome::optional<float> load(esphome::ESPPreferenceObject& storage);
private: private:
// Retrieve the HardwareSerial pointer from friend and subclasses. // Retrieve the HardwareSerial pointer from friend and subclasses.