ESPHome  2024.11.0
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)
23  MQTT_COMPONENT_CUSTOM_TOPIC(current_humidity, state)
35  MQTT_COMPONENT_CUSTOM_TOPIC(away, command)
43 
44  protected:
45  const EntityBase *get_entity() const override;
46 
47  bool publish_state_();
48 
50 };
51 
52 } // namespace mqtt
53 } // namespace esphome
54 
55 #endif
56 #endif // USE_MQTT
float target_temperature_low
Definition: climate.h:140
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
float target_temperature_high
Definition: climate.h:141
MQTTClimateComponent(climate::Climate *device)
float target_humidity
Definition: climate.h:589
ClimateSwingMode swing_mode
Definition: climate.h:581
virtual const EntityBase * get_entity() const =0
Gets the Entity served by this MQTT component.
state command command command command command command state state state MQTT_COMPONENT_CUSTOM_TOPIC(preset, command) protected bool publish_state_()
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:183
Simple Helper struct used for Home Assistant MQTT send_discovery().
ClimateFanMode fan_mode
Definition: climate.h:573
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
std::string component_type() const override
MQTT_COMPONENT_CUSTOM_TOPIC(current_temperature, state) MQTT_COMPONENT_CUSTOM_TOPIC(current_humidity
float target_temperature
Definition: climate.h:138
ClimatePreset preset
Definition: climate.h:578
ClimateDevice - This is the base class for all climate integrations.
Definition: climate.h:168
bool state
Definition: fan.h:34
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...