mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 16:49:11 +03:00
check Mqtt::enabled
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user