diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 12a6a35a2..3fac2d502 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -1340,6 +1340,7 @@ void PublishStatus(uint8_t payload) if ((0 == payload) || (99 == payload)) { uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : (!devices_present) ? 1 : devices_present; + if (SONOFF_IFAN02 == Settings.module) { maxfn = 1; } stemp[0] = '\0'; for (byte i = 0; i < maxfn; i++) { snprintf_P(stemp, sizeof(stemp), PSTR("%s%s\"%s\"" ), stemp, (i > 0 ? "," : ""), Settings.friendlyname[i]); diff --git a/sonoff/xdrv_01_mqtt.ino b/sonoff/xdrv_01_mqtt.ino index aa43dd85d..a526f489d 100644 --- a/sonoff/xdrv_01_mqtt.ino +++ b/sonoff/xdrv_01_mqtt.ino @@ -284,8 +284,8 @@ void MqttPublishPowerState(byte device) if ((device < 1) || (device > devices_present)) { device = 1; } - if ((SONOFF_IFAN02 == Settings.module) && (device > 1)) { // Do not report status of fan relays - if (GetFanspeed() < 4) { + if ((SONOFF_IFAN02 == Settings.module) && (device > 1)) { + if (GetFanspeed() < 4) { // 4 occurs when fanspeed is 3 and RC button 2 is pressed snprintf_P(scommand, sizeof(scommand), PSTR(D_CMND_FANSPEED)); GetTopic_P(stopic, STAT, mqtt_topic, (Settings.flag.mqtt_response) ? scommand : S_RSLT_RESULT); snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_NVALUE, scommand, GetFanspeed()); diff --git a/sonoff/xdrv_02_webserver.ino b/sonoff/xdrv_02_webserver.ino index f658a2098..b29e32ea2 100644 --- a/sonoff/xdrv_02_webserver.ino +++ b/sonoff/xdrv_02_webserver.ino @@ -942,6 +942,7 @@ void HandleOtherConfiguration() page += FPSTR(HTTP_FORM_OTHER); page.replace(F("{r1"), (Settings.flag.mqtt_enabled) ? F(" checked") : F("")); uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : (!devices_present) ? 1 : devices_present; + if (SONOFF_IFAN02 == Settings.module) { maxfn = 1; } for (byte i = 0; i < maxfn; i++) { page += FPSTR(HTTP_FORM_OTHER2); page.replace(F("{1"), String(i +1)); @@ -1659,6 +1660,7 @@ void HandleInformation() func += F("}1" D_BOOT_COUNT "}2"); func += String(Settings.bootcount); func += F("}1" D_RESTART_REASON "}2"); func += GetResetReason(); uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : devices_present; + if (SONOFF_IFAN02 == Settings.module) { maxfn = 1; } for (byte i = 0; i < maxfn; i++) { func += F("}1" D_FRIENDLY_NAME " "); func += i +1; func += F("}2"); func += Settings.friendlyname[i]; }