Fix MaxPower functionality

Fix MaxPower functionality (#7647)
This commit is contained in:
Theo Arends 2020-02-09 16:21:48 +01:00
parent 286a0c4fe4
commit 504570d5d5
4 changed files with 8 additions and 3 deletions

View File

@ -71,6 +71,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Fix ``RGBWWTable`` ignored (#7572)
- Fix PWM flickering at low levels (#7415)
- Fix Hass sensor discovery part 1/4 by Federico Leoni (#7582, #7548)
- Fix MaxPower functionality (#7647)
- Add command ``SetOption79 0/1`` to enable reset of counters at teleperiod time by Andre Thomas (#7355)
- Add command ``SetOption82 0/1`` to limit the CT range for Alexa to 200..380
- Add command ``SetOption84 1`` to send AWS IoT device shadow updates (alternative to retained)
@ -95,3 +96,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for sensors DS18x20 and DHT family on Shelly 1 and Shelly 1PM using Shelly Add-On adapter (#7469)
- Add support for MI-BLE sensors using HM-10 Bluetooth 4.0 module by Christian Staars (#7683)
- Add BootCount Reset Time as BCResetTime to ``Status 1``
- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1``

View File

@ -3,12 +3,13 @@
### 8.1.0.6 20200205
- Fix Hass sensor discovery part 1/4 by Federico Leoni (#7582, #7548)
- Fix MaxPower functionality (#7647)
- Add support for sensors DS18x20 and DHT family on Shelly 1 and Shelly 1PM using Shelly Add-On adapter (#7469)
- Add commands ``SwitchMode 11`` PushHoldMulti and ``SwitchMode 12`` PushHoldInverted (#7603)
- Add command ``Buzzer -1`` for infinite mode and command ``Buzzer -2`` for following led mode (#7623)
- Add support for MI-BLE sensors using HM-10 Bluetooth 4.0 module by Christian Staars (#7683)
- Add BootCount Reset Time as BCResetTime to ``Status 1``
- Add ``ZbZNPReceived``and ``ZbZCLReceived``are published to MQTT when ``SetOption66 1``
- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1``
### 8.1.0.5 20200126

View File

@ -235,7 +235,8 @@ void SetDevicePower(power_t rpower, uint32_t source)
void RestorePower(bool publish_power, uint32_t source)
{
if (power != last_power) {
SetDevicePower(last_power, source);
power = last_power;
SetDevicePower(power, source);
if (publish_power) {
MqttPublishAllPowerState();
}

View File

@ -365,7 +365,7 @@ void EnergyMarginCheck(void)
EnergyMqttShow();
SetAllPower(POWER_ALL_OFF, SRC_MAXPOWER);
if (!Energy.mplr_counter) {
Energy.mplr_counter = Settings.param[P_MAX_POWER_RETRY] +1;
Energy.mplr_counter = Settings.param[P_MAX_POWER_RETRY] +1; // SetOption33 - Max Power Retry count
}
Energy.mplw_counter = Settings.energy_max_power_limit_window;
}
@ -390,6 +390,7 @@ void EnergyMarginCheck(void)
ResponseTime_P(PSTR(",\"" D_JSON_MAXPOWERREACHEDRETRY "\":\"%s\"}"), GetStateText(0));
MqttPublishPrefixTopic_P(STAT, S_RSLT_WARNING);
EnergyMqttShow();
SetAllPower(POWER_ALL_OFF, SRC_MAXPOWER);
}
}
}