check Mqtt::enabled

This commit is contained in:
MichaelDvP
2025-12-21 11:17:31 +01:00
parent f1841347a7
commit 9957bff62b
4 changed files with 4 additions and 4 deletions

View File

@@ -664,7 +664,7 @@ void AnalogSensor::remove_ha_topic(const int8_t type, const uint8_t gpio) const
void AnalogSensor::publish_values(const bool force) {
uint8_t num_sensors = sensors_.size();
if (!Mqtt::connected() || num_sensors == 0) {
if (!Mqtt::enabled() || num_sensors == 0) {
return;
}

View File

@@ -129,7 +129,7 @@
// Thermostat remote - 0x38
{ 3, DeviceType::THERMOSTAT, "RT800, RC220", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
{200, DeviceType::THERMOSTAT, "RC100H, CR10H", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
{249, DeviceType::THERMOSTAT, "TR120RF, CR20RF", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
{249, DeviceType::THERMOSTAT, "RC120RF, TR120RF, CR20RF", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
// Solar Modules - 0x30 (for solar), 0x2A, 0x41 (for ww)
{ 73, DeviceType::SOLAR, "SM10", DeviceFlags::EMS_DEVICE_FLAG_SM10},

View File

@@ -379,7 +379,7 @@ void WebCustomEntityService::publish_single(CustomEntityItem & entity) {
// publish to Mqtt
void WebCustomEntityService::publish(const bool force) {
if (!Mqtt::connected() || customEntityItems_->empty()) {
if (!Mqtt::enabled() || customEntityItems_->empty()) {
return;
}
if (force) {

View File

@@ -213,7 +213,7 @@ void WebSchedulerService::publish_single(const char * name, const bool state) {
// publish to Mqtt
void WebSchedulerService::publish(const bool force) {
if (!Mqtt::connected() || scheduleItems_->empty()) {
if (!Mqtt::enabled() || scheduleItems_->empty()) {
return;
}
if (force) {