ESPHome  2022.11.4
mqtt_climate.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "esphome/core/defines.h"
4 
5 #ifdef USE_MQTT
6 #ifdef USE_CLIMATE
7 
9 #include "mqtt_component.h"
10 
11 namespace esphome {
12 namespace mqtt {
13 
15  public:
17  void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
18  bool send_initial_state() override;
19  std::string component_type() const override;
20  void setup() override;
21 
22  MQTT_COMPONENT_CUSTOM_TOPIC(current_temperature, state)
32  MQTT_COMPONENT_CUSTOM_TOPIC(away, command)
38 
39  protected:
40  const EntityBase *get_entity() const override;
41 
42  bool publish_state_();
43 
45 };
46 
47 } // namespace mqtt
48 } // namespace esphome
49 
50 #endif
51 #endif // USE_MQTT
float target_temperature_low
Definition: climate.h:552
const EntityBase * get_entity() const override
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
float target_temperature_high
Definition: climate.h:553
MQTTClimateComponent(climate::Climate *device)
ClimateSwingMode swing_mode
Definition: climate.h:548
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:151
Simple Helper struct used for Home Assistant MQTT send_discovery().
ClimateFanMode fan_mode
Definition: climate.h:540
MQTT_COMPONENT_CUSTOM_TOPIC(current_temperature, state) MQTT_COMPONENT_CUSTOM_TOPIC(mode
Definition: a4988.cpp:4
std::string component_type() const override
float target_temperature
Definition: climate.h:550
ClimateDevice - This is the base class for all climate integrations.
Definition: climate.h:167
bool state
Definition: fan.h:34
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...