Fix unwanted Domoticz messages

Fix unwanted Domoticz messages (#8355)
This commit is contained in:
Theo Arends 2020-05-06 17:23:14 +02:00
parent 2c140174fd
commit 0d19fd4654
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ void DomoticzUpdateFanState(void)
void MqttPublishDomoticzPowerState(uint8_t device)
{
if (Settings.flag.mqtt_enabled) { // SetOption3 - Enable MQTT
if ((device < 1) || (device > devices_present)) { device = 1; }
if ((device < 1) || (device > devices_present) || (device > MAX_DOMOTICZ_IDX)) { device = 1; }
if (Settings.domoticz_relay_idx[device -1]) {
#ifdef USE_SHUTTER
if (domoticz_is_shutter) {