mirror of
https://github.com/esphome/esphome.git
synced 2026-05-21 17:39:00 +08:00
[mqtt] Move Home Assistant discovery keys to PROGMEM on ESP8266 (#13011)
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.custom";
|
||||
|
||||
@@ -29,7 +28,6 @@ bool CustomMQTTDevice::publish_json(const std::string &topic, const json::json_b
|
||||
}
|
||||
bool CustomMQTTDevice::is_connected() { return global_mqtt_client != nullptr && global_mqtt_client->is_connected(); }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "mqtt_client.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
/** This class is a helper class for custom components that communicate using
|
||||
* MQTT. It has 5 helper functions that you can use (square brackets indicate optional):
|
||||
@@ -214,7 +213,6 @@ void CustomMQTTDevice::subscribe_json(const std::string &topic, void (T::*callba
|
||||
global_mqtt_client->subscribe_json(topic, f, qos);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_ALARM_CONTROL_PANEL
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.alarm_control_panel";
|
||||
|
||||
@@ -123,8 +122,7 @@ bool MQTTAlarmControlPanelComponent::publish_state() {
|
||||
return this->publish(this->get_state_topic_(), state_s);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "mqtt_component.h"
|
||||
#include "esphome/components/alarm_control_panel/alarm_control_panel.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTAlarmControlPanelComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -32,8 +31,7 @@ class MQTTAlarmControlPanelComponent : public mqtt::MQTTComponent {
|
||||
alarm_control_panel::AlarmControlPanel *alarm_control_panel_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/components/network/ip_address.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
enum class MQTTClientDisconnectReason : int8_t {
|
||||
TCP_DISCONNECTED = 0,
|
||||
@@ -67,6 +66,5 @@ class MQTTBackend {
|
||||
virtual void loop() {}
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
#endif
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.idf";
|
||||
|
||||
@@ -270,7 +269,6 @@ bool MQTTBackendESP32::enqueue_(MqttQueueTypeT type, const char *topic, int qos,
|
||||
}
|
||||
#endif // USE_MQTT_IDF_ENQUEUE
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
#endif // USE_ESP32
|
||||
#endif
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
#include "esphome/core/lock_free_queue.h"
|
||||
#include "esphome/core/event_pool.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
struct Event {
|
||||
esp_mqtt_event_id_t event_id;
|
||||
@@ -273,8 +272,7 @@ class MQTTBackendESP32 final : public MQTTBackend {
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <AsyncMqttClient.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTBackendESP8266 final : public MQTTBackend {
|
||||
public:
|
||||
@@ -67,8 +66,7 @@ class MQTTBackendESP8266 final : public MQTTBackend {
|
||||
AsyncMqttClient mqtt_client_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // defined(USE_ESP8266)
|
||||
#endif
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <AsyncMqttClient.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTBackendLibreTiny final : public MQTTBackend {
|
||||
public:
|
||||
@@ -67,8 +66,7 @@ class MQTTBackendLibreTiny final : public MQTTBackend {
|
||||
AsyncMqttClient mqtt_client_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // defined(USE_LIBRETINY)
|
||||
#endif
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.binary_sensor";
|
||||
|
||||
@@ -57,8 +56,7 @@ bool MQTTBinarySensorComponent::publish_state(bool state) {
|
||||
return this->publish(this->get_state_topic_(), state_s);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
#include "mqtt_component.h"
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTBinarySensorComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -36,8 +35,7 @@ class MQTTBinarySensorComponent : public mqtt::MQTTComponent {
|
||||
binary_sensor::BinarySensor *binary_sensor_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_BUTTON
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.button";
|
||||
|
||||
@@ -43,8 +42,7 @@ void MQTTButtonComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCon
|
||||
std::string MQTTButtonComponent::component_type() const { return "button"; }
|
||||
const EntityBase *MQTTButtonComponent::get_entity() const { return this->button_; }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/button/button.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTButtonComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -33,8 +32,7 @@ class MQTTButtonComponent : public mqtt::MQTTComponent {
|
||||
button::Button *button_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#include "esphome/components/dashboard_import/dashboard_import.h"
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt";
|
||||
|
||||
@@ -751,7 +750,6 @@ void MQTTMessageTrigger::dump_config() {
|
||||
}
|
||||
float MQTTMessageTrigger::get_setup_priority() const { return setup_priority::AFTER_CONNECTION; }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
/** Callback for MQTT events.
|
||||
*/
|
||||
@@ -462,7 +461,6 @@ template<typename... Ts> class MQTTDisableAction : public Action<Ts...> {
|
||||
MQTTClientComponent *parent_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_CLIMATE
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.climate";
|
||||
|
||||
@@ -460,8 +459,7 @@ bool MQTTClimateComponent::publish_state_() {
|
||||
return success;
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/climate/climate.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTClimateComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -49,8 +48,7 @@ class MQTTClimateComponent : public mqtt::MQTTComponent {
|
||||
climate::Climate *device_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#include "mqtt_const.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.component";
|
||||
|
||||
@@ -306,7 +305,6 @@ bool MQTTComponent::is_internal() {
|
||||
return this->get_entity()->is_internal();
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
#include "esphome/core/string_ref.h"
|
||||
#include "mqtt_client.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
/// Simple Helper struct used for Home Assistant MQTT send_discovery().
|
||||
struct SendDiscoveryConfig {
|
||||
@@ -205,7 +204,6 @@ class MQTTComponent : public Component {
|
||||
bool resend_state_{false};
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_MQTt
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_COVER
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.cover";
|
||||
|
||||
@@ -119,8 +118,7 @@ bool MQTTCoverComponent::publish_state() {
|
||||
return success;
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#include "esphome/components/cover/cover.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTCoverComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -36,8 +35,7 @@ class MQTTCoverComponent : public mqtt::MQTTComponent {
|
||||
cover::Cover *cover_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_DATETIME_DATE
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.datetime";
|
||||
|
||||
@@ -62,8 +61,7 @@ bool MQTTDateComponent::publish_state(uint16_t year, uint8_t month, uint8_t day)
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_DATE
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/datetime/date_entity.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTDateComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -38,8 +37,7 @@ class MQTTDateComponent : public mqtt::MQTTComponent {
|
||||
datetime::DateEntity *date_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_DATE
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_DATETIME_DATETIME
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.datetime.datetime";
|
||||
|
||||
@@ -78,8 +77,7 @@ bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_DATETIME
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/datetime/datetime_entity.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTDateTimeComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -38,8 +37,7 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
|
||||
datetime::DateTimeEntity *datetime_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_DATETIME
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_EVENT
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.event";
|
||||
|
||||
@@ -54,8 +53,7 @@ bool MQTTEventComponent::publish_event_(const std::string &event_type) {
|
||||
std::string MQTTEventComponent::component_type() const { return "event"; }
|
||||
const EntityBase *MQTTEventComponent::get_entity() const { return this->event_; }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/event/event.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTEventComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -32,8 +31,7 @@ class MQTTEventComponent : public mqtt::MQTTComponent {
|
||||
event::Event *event_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_FAN
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.fan";
|
||||
|
||||
@@ -182,8 +181,7 @@ bool MQTTFanComponent::publish_state() {
|
||||
return !failed;
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/fan/fan.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTFanComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -47,8 +46,7 @@ class MQTTFanComponent : public mqtt::MQTTComponent {
|
||||
fan::Fan *state_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#ifdef USE_LIGHT
|
||||
|
||||
#include "esphome/components/light/light_json_schema.h"
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.light";
|
||||
|
||||
@@ -92,8 +91,7 @@ void MQTTJSONLightComponent::dump_config() {
|
||||
LOG_MQTT_COMPONENT(true, true)
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "mqtt_component.h"
|
||||
#include "esphome/components/light/light_state.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTJSONLightComponent : public mqtt::MQTTComponent, public light::LightRemoteValuesListener {
|
||||
public:
|
||||
@@ -37,8 +36,7 @@ class MQTTJSONLightComponent : public mqtt::MQTTComponent, public light::LightRe
|
||||
light::LightState *state_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_LOCK
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.lock";
|
||||
|
||||
@@ -58,8 +57,7 @@ bool MQTTLockComponent::publish_state() {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/lock/lock.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTLockComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -34,8 +33,7 @@ class MQTTLockComponent : public mqtt::MQTTComponent {
|
||||
lock::Lock *lock_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_NUMBER
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.number";
|
||||
|
||||
@@ -80,8 +79,7 @@ bool MQTTNumberComponent::publish_state(float value) {
|
||||
return this->publish(this->get_state_topic_(), buffer);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/number/number.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTNumberComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -39,8 +38,7 @@ class MQTTNumberComponent : public mqtt::MQTTComponent {
|
||||
number::Number *number_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_SELECT
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.select";
|
||||
|
||||
@@ -53,8 +52,7 @@ bool MQTTSelectComponent::publish_state(const std::string &value) {
|
||||
return this->publish(this->get_state_topic_(), value);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/select/select.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTSelectComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -39,8 +38,7 @@ class MQTTSelectComponent : public mqtt::MQTTComponent {
|
||||
select::Select *select_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
#include "esphome/components/deep_sleep/deep_sleep_component.h"
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.sensor";
|
||||
|
||||
@@ -86,8 +85,7 @@ bool MQTTSensorComponent::publish_state(float value) {
|
||||
return this->publish(this->get_state_topic_(), value_accuracy_to_string(value, accuracy));
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTSensorComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -51,8 +50,7 @@ class MQTTSensorComponent : public mqtt::MQTTComponent {
|
||||
optional<uint32_t> expire_after_; // Override the expire after advertised to Home Assistant
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_SWITCH
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.switch";
|
||||
|
||||
@@ -57,8 +56,7 @@ bool MQTTSwitchComponent::publish_state(bool state) {
|
||||
return this->publish(this->get_state_topic_(), state_s);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/switch/switch.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTSwitchComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -34,8 +33,7 @@ class MQTTSwitchComponent : public mqtt::MQTTComponent {
|
||||
switch_::Switch *switch_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_TEXT
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.text";
|
||||
|
||||
@@ -57,8 +56,7 @@ bool MQTTTextComponent::publish_state(const std::string &value) {
|
||||
return this->publish(this->get_state_topic_(), value);
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/text/text.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTTextComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -39,8 +38,7 @@ class MQTTTextComponent : public mqtt::MQTTComponent {
|
||||
text::Text *text_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.text_sensor";
|
||||
|
||||
@@ -43,8 +42,7 @@ bool MQTTTextSensor::send_initial_state() {
|
||||
std::string MQTTTextSensor::component_type() const { return "sensor"; }
|
||||
const EntityBase *MQTTTextSensor::get_entity() const { return this->sensor_; }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/text_sensor/text_sensor.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTTextSensor : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -32,8 +31,7 @@ class MQTTTextSensor : public mqtt::MQTTComponent {
|
||||
text_sensor::TextSensor *sensor_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_DATETIME_TIME
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.datetime.time";
|
||||
|
||||
@@ -62,8 +61,7 @@ bool MQTTTimeComponent::publish_state(uint8_t hour, uint8_t minute, uint8_t seco
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_TIME
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/datetime/time_entity.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTTimeComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -38,8 +37,7 @@ class MQTTTimeComponent : public mqtt::MQTTComponent {
|
||||
datetime::TimeEntity *time_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_DATETIME_DATE
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#ifdef USE_MQTT
|
||||
#ifdef USE_UPDATE
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
static const char *const TAG = "mqtt.update";
|
||||
|
||||
@@ -56,8 +55,7 @@ void MQTTUpdateComponent::dump_config() {
|
||||
std::string MQTTUpdateComponent::component_type() const { return "update"; }
|
||||
const EntityBase *MQTTUpdateComponent::get_entity() const { return this->update_; }
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_UPDATE
|
||||
#endif // USE_MQTT
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/components/update/update_entity.h"
|
||||
#include "mqtt_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace mqtt {
|
||||
namespace esphome::mqtt {
|
||||
|
||||
class MQTTUpdateComponent : public mqtt::MQTTComponent {
|
||||
public:
|
||||
@@ -34,8 +33,7 @@ class MQTTUpdateComponent : public mqtt::MQTTComponent {
|
||||
update::UpdateEntity *update_;
|
||||
};
|
||||
|
||||
} // namespace mqtt
|
||||
} // namespace esphome
|
||||
} // namespace esphome::mqtt
|
||||
|
||||
#endif // USE_UPDATE
|
||||
#endif // USE_MQTT
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user