mirror of
https://github.com/esphome/esphome.git
synced 2025-08-03 17:07:54 +00:00
no real good option but to disable them all manually
This commit is contained in:
parent
808066f564
commit
a7e74bb7de
@ -55,6 +55,7 @@ void MQTTAlarmControlPanelComponent::dump_config() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MQTTAlarmControlPanelComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTAlarmControlPanelComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
JsonArray supported_features = root[MQTT_SUPPORTED_FEATURES].to<JsonArray>();
|
JsonArray supported_features = root[MQTT_SUPPORTED_FEATURES].to<JsonArray>();
|
||||||
const uint32_t acp_supported_features = this->alarm_control_panel_->get_supported_features();
|
const uint32_t acp_supported_features = this->alarm_control_panel_->get_supported_features();
|
||||||
if (acp_supported_features & ACP_FEAT_ARM_AWAY) {
|
if (acp_supported_features & ACP_FEAT_ARM_AWAY) {
|
||||||
|
@ -30,6 +30,7 @@ MQTTBinarySensorComponent::MQTTBinarySensorComponent(binary_sensor::BinarySensor
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MQTTBinarySensorComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTBinarySensorComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
if (!this->binary_sensor_->get_device_class().empty())
|
if (!this->binary_sensor_->get_device_class().empty())
|
||||||
root[MQTT_DEVICE_CLASS] = this->binary_sensor_->get_device_class();
|
root[MQTT_DEVICE_CLASS] = this->binary_sensor_->get_device_class();
|
||||||
if (this->binary_sensor_->is_status_binary_sensor())
|
if (this->binary_sensor_->is_status_binary_sensor())
|
||||||
|
@ -32,6 +32,7 @@ void MQTTButtonComponent::dump_config() {
|
|||||||
|
|
||||||
void MQTTButtonComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTButtonComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
config.state_topic = false;
|
config.state_topic = false;
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
if (!this->button_->get_device_class().empty())
|
if (!this->button_->get_device_class().empty())
|
||||||
root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
|
root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ static const char *const TAG = "mqtt.climate";
|
|||||||
using namespace esphome::climate;
|
using namespace esphome::climate;
|
||||||
|
|
||||||
void MQTTClimateComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTClimateComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
auto traits = this->device_->get_traits();
|
auto traits = this->device_->get_traits();
|
||||||
// current_temperature_topic
|
// current_temperature_topic
|
||||||
if (traits.get_supports_current_temperature()) {
|
if (traits.get_supports_current_temperature()) {
|
||||||
@ -28,6 +29,7 @@ void MQTTClimateComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCo
|
|||||||
// mode_state_topic
|
// mode_state_topic
|
||||||
root[MQTT_MODE_STATE_TOPIC] = this->get_mode_state_topic();
|
root[MQTT_MODE_STATE_TOPIC] = this->get_mode_state_topic();
|
||||||
// modes
|
// modes
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
JsonArray modes = root[MQTT_MODES].to<JsonArray>();
|
JsonArray modes = root[MQTT_MODES].to<JsonArray>();
|
||||||
// sort array for nice UI in HA
|
// sort array for nice UI in HA
|
||||||
if (traits.supports_mode(CLIMATE_MODE_AUTO))
|
if (traits.supports_mode(CLIMATE_MODE_AUTO))
|
||||||
|
@ -67,6 +67,7 @@ void MQTTCoverComponent::dump_config() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MQTTCoverComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTCoverComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
if (!this->cover_->get_device_class().empty())
|
if (!this->cover_->get_device_class().empty())
|
||||||
root[MQTT_DEVICE_CLASS] = this->cover_->get_device_class();
|
root[MQTT_DEVICE_CLASS] = this->cover_->get_device_class();
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ bool MQTTDateComponent::send_initial_state() {
|
|||||||
}
|
}
|
||||||
bool MQTTDateComponent::publish_state(uint16_t year, uint8_t month, uint8_t day) {
|
bool MQTTDateComponent::publish_state(uint16_t year, uint8_t month, uint8_t day) {
|
||||||
return this->publish_json(this->get_state_topic_(), [year, month, day](JsonObject root) {
|
return this->publish_json(this->get_state_topic_(), [year, month, day](JsonObject root) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
root["year"] = year;
|
root["year"] = year;
|
||||||
root["month"] = month;
|
root["month"] = month;
|
||||||
root["day"] = day;
|
root["day"] = day;
|
||||||
|
@ -68,6 +68,7 @@ bool MQTTDateTimeComponent::send_initial_state() {
|
|||||||
bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute,
|
bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute,
|
||||||
uint8_t second) {
|
uint8_t second) {
|
||||||
return this->publish_json(this->get_state_topic_(), [year, month, day, hour, minute, second](JsonObject root) {
|
return this->publish_json(this->get_state_topic_(), [year, month, day, hour, minute, second](JsonObject root) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
root["year"] = year;
|
root["year"] = year;
|
||||||
root["month"] = month;
|
root["month"] = month;
|
||||||
root["day"] = day;
|
root["day"] = day;
|
||||||
|
@ -16,6 +16,7 @@ using namespace esphome::event;
|
|||||||
MQTTEventComponent::MQTTEventComponent(event::Event *event) : event_(event) {}
|
MQTTEventComponent::MQTTEventComponent(event::Event *event) : event_(event) {}
|
||||||
|
|
||||||
void MQTTEventComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTEventComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
JsonArray event_types = root[MQTT_EVENT_TYPES].to<JsonArray>();
|
JsonArray event_types = root[MQTT_EVENT_TYPES].to<JsonArray>();
|
||||||
for (const auto &event_type : this->event_->get_event_types())
|
for (const auto &event_type : this->event_->get_event_types())
|
||||||
event_types.add(event_type);
|
event_types.add(event_type);
|
||||||
@ -40,8 +41,10 @@ void MQTTEventComponent::dump_config() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MQTTEventComponent::publish_event_(const std::string &event_type) {
|
bool MQTTEventComponent::publish_event_(const std::string &event_type) {
|
||||||
return this->publish_json(this->get_state_topic_(),
|
return this->publish_json(this->get_state_topic_(), [event_type](JsonObject root) {
|
||||||
[event_type](JsonObject root) { root[MQTT_EVENT_TYPE] = event_type; });
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
|
root[MQTT_EVENT_TYPE] = event_type;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MQTTEventComponent::component_type() const { return "event"; }
|
std::string MQTTEventComponent::component_type() const { return "event"; }
|
||||||
|
@ -144,6 +144,7 @@ bool MQTTFanComponent::send_initial_state() { return this->publish_state(); }
|
|||||||
|
|
||||||
void MQTTFanComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTFanComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
if (this->state_->get_traits().supports_direction()) {
|
if (this->state_->get_traits().supports_direction()) {
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
root[MQTT_DIRECTION_COMMAND_TOPIC] = this->get_direction_command_topic();
|
root[MQTT_DIRECTION_COMMAND_TOPIC] = this->get_direction_command_topic();
|
||||||
root[MQTT_DIRECTION_STATE_TOPIC] = this->get_direction_state_topic();
|
root[MQTT_DIRECTION_STATE_TOPIC] = this->get_direction_state_topic();
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ std::string MQTTLockComponent::component_type() const { return "lock"; }
|
|||||||
const EntityBase *MQTTLockComponent::get_entity() const { return this->lock_; }
|
const EntityBase *MQTTLockComponent::get_entity() const { return this->lock_; }
|
||||||
void MQTTLockComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTLockComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
if (this->lock_->traits.get_assumed_state())
|
if (this->lock_->traits.get_assumed_state())
|
||||||
|
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
|
||||||
root[MQTT_OPTIMISTIC] = true;
|
root[MQTT_OPTIMISTIC] = true;
|
||||||
if (this->lock_->traits.get_supports_open())
|
if (this->lock_->traits.get_supports_open())
|
||||||
root[MQTT_PAYLOAD_OPEN] = "OPEN";
|
root[MQTT_PAYLOAD_OPEN] = "OPEN";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user