From 4d070bfb157f0db7b0c0ad8e6e79050bb55fba42 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 24 May 2019 15:04:48 +0200 Subject: [PATCH] Change default PowerDelta from 80% to 0% on new installations Change default PowerDelta from 80% to 0% on new installations (#5858, #5028, #4813, #4130, #4145, #3795, #3778, #3660, #3648) --- sonoff/_changelog.ino | 1 + sonoff/settings.ino | 4 ++-- sonoff/sonoff.h | 1 - sonoff/xdrv_03_energy.ino | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 0a96b4630..276084707 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -6,6 +6,7 @@ * Fix core 2.5.x ISR not in IRAM exception (#5837) * Add support for VL53L0x time of flight sensor. Might interfere with TSL2561 using same I2C address (#5845) * Add command AdcParam to control ADC0 Temperature and Light formula parameters + * Change default PowerDelta from 80% to 0% on new installations (#5858, #5028, #4813, #4130, #4145, #3795, #3778, #3660, #3648) * * 6.5.0.11 20190517 * Add command SetOption64 0/1 to switch between "-" or "_" as sensor index separator impacting DS18X20, DHT, BMP and SHT3X sensor names (#5689) diff --git a/sonoff/settings.ino b/sonoff/settings.ino index 0adc1ab9e..7d957ba14 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -789,7 +789,7 @@ void SettingsDefaultSet2(void) // Settings.flag2.wattage_resolution = 0; Settings.flag2.energy_resolution = ENERGY_RESOLUTION; Settings.param[P_MAX_POWER_RETRY] = MAX_POWER_RETRY; - Settings.energy_power_delta = DEFAULT_POWER_DELTA; +// Settings.energy_power_delta = 0; Settings.energy_power_calibration = HLW_PREF_PULSE; Settings.energy_voltage_calibration = HLW_UREF_PULSE; Settings.energy_current_calibration = HLW_IREF_PULSE; @@ -1047,7 +1047,7 @@ void SettingsDelta(void) } if (Settings.version < 0x050C0005) { Settings.light_rotation = 0; - Settings.energy_power_delta = DEFAULT_POWER_DELTA; + Settings.energy_power_delta = 0; char fingerprint[60]; memcpy(fingerprint, Settings.mqtt_fingerprint, sizeof(fingerprint)); char *p = fingerprint; diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 9b3ed0020..8be609155 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -99,7 +99,6 @@ const uint16_t PWM_MIN = 100; // [PWM_MIN] Minimum frequency - Def // For Controlling Servos use 50 and also set PWM_FREQ as 50 (DO NOT USE THESE VALUES FOR DIMMERS) //#define PWM_LIGHTSCHEME0_IGNORE_SLEEP // Do not change sleep value for LightAnimate() scheme 0 -const uint8_t DEFAULT_POWER_DELTA = 80; // Power change percentage const uint16_t MAX_POWER_HOLD = 10; // Time in SECONDS to allow max agreed power const uint16_t MAX_POWER_WINDOW = 30; // Time in SECONDS to disable allow max agreed power const uint16_t SAFE_POWER_HOLD = 10; // Time in SECONDS to allow max unit safe power diff --git a/sonoff/xdrv_03_energy.ino b/sonoff/xdrv_03_energy.ino index 74867263e..1d47bc034 100644 --- a/sonoff/xdrv_03_energy.ino +++ b/sonoff/xdrv_03_energy.ino @@ -349,7 +349,7 @@ bool EnergyCommand(void) } else if (CMND_POWERDELTA == command_code) { if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < 101)) { - Settings.energy_power_delta = (1 == XdrvMailbox.payload) ? DEFAULT_POWER_DELTA : XdrvMailbox.payload; + Settings.energy_power_delta = XdrvMailbox.payload; } nvalue = Settings.energy_power_delta; unit = UNIT_PERCENTAGE;