ESPHome  2023.11.6
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)
40 
41  protected:
42  const EntityBase *get_entity() const override;
43 
44  bool publish_state_();
45 
47 };
48 
49 } // namespace mqtt
50 } // namespace esphome
51 
52 #endif
53 #endif // USE_MQTT
float target_temperature_low
Definition: climate.h:545
const EntityBase * get_entity() const override
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
float target_temperature_high
Definition: climate.h:546
MQTTClimateComponent(climate::Climate *device)
ClimateSwingMode swing_mode
Definition: climate.h:541
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:533
MQTT_COMPONENT_CUSTOM_TOPIC(current_temperature, state) MQTT_COMPONENT_CUSTOM_TOPIC(mode
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
std::string component_type() const override
float target_temperature
Definition: climate.h:543
ClimatePreset preset
Definition: climate.h:538
ClimateDevice - This is the base class for all climate integrations.
Definition: climate.h:161
bool state
Definition: fan.h:34
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...