From 4536746d032b35f80cb73649764f65cbf311ae2b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 28 Apr 2020 11:09:56 +0200 Subject: [PATCH] Update Changelog and Release notes --- RELEASENOTES.md | 3 ++- tasmota/CHANGELOG.md | 1 + tasmota/settings.h | 2 +- tasmota/xsns_02_analog.ino | 31 +++++++++++++++---------------- tools/decode-status.py | 6 +++--- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d7e8d2bf1..62a21c61f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -61,7 +61,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034) - Change remove floating point libs from IRAM - Change remove MQTT Info messages on restart for DeepSleep Wake (#8044) -- Change IRremoteESP8266 library updated to v2.7.5 +- Change IRremoteESP8266 library updated to v2.7.6 - Fix possible Relay toggle on (OTA) restart - Fix PWM flickering during wifi connection (#8046) - Fix Zigbee sending wrong Sat value with Hue emulation @@ -78,6 +78,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add command ``SetOption73 1`` for button decoupling and send multi-press and hold MQTT messages by Federico Leoni (#8235) - Add command ``SetOption90 1`` to disable non-json MQTT messages (#8044) - Add command ``SetOption91 1`` to enable fading at startup / power on +- Add command ``SetOption92 1`` to set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...) - Add command ``Sensor10 0/1/2`` to control BH1750 resolution - 0 = High (default), 1 = High2, 2 = Low (#8016) - Add command ``Sensor10 31..254`` to control BH1750 measurement time which defaults to 69 (#8016) - Add command ``Sensor18 0..32000`` to control PMS5003 sensor interval to extend lifetime by Gene Ruebsamen (#8128) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 9d6b6c8e0..f3b36fcf5 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix Zigbee DimmerUp/DimmerDown malformed - Add config version tag - Add command ``SetOption73 1`` for button decoupling and send multi-press and hold MQTT messages by Federico Leoni (#8235) +- Add command ``SetOption92 1`` to set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...) - Add command ``SO`` as shortcut for command ``SetOption`` ### 8.2.0.3 20200329 diff --git a/tasmota/settings.h b/tasmota/settings.h index ae9243c70..ccf3e44ed 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -111,7 +111,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t zigbee_distinct_topics : 1; // bit 7 (v8.1.0.10) - SetOption89 - Distinct MQTT topics per device for Zigbee (#7835) uint32_t only_json_message : 1; // bit 8 (v8.2.0.3) - SetOption90 - Disable non-json MQTT response uint32_t fade_at_startup : 1; // bit 9 (v8.2.0.3) - SetOption91 - Enable light fading at start/power on - uint32_t pwm_ct_mode : 1; // bit 10 () - SetOption92 - Set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...) + uint32_t pwm_ct_mode : 1; // bit 10 (v8.2.0.4) - SetOption92 - Set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...) uint32_t spare11 : 1; uint32_t spare12 : 1; uint32_t spare13 : 1; diff --git a/tasmota/xsns_02_analog.ino b/tasmota/xsns_02_analog.ino index 41be46ff8..019eed86a 100644 --- a/tasmota/xsns_02_analog.ino +++ b/tasmota/xsns_02_analog.ino @@ -167,26 +167,25 @@ void AdcGetCurrentPower(uint8_t factor) uint16_t analog_min = 1023; uint16_t analog_max = 0; - if(Settings.adc_param1==0){ - for (uint32_t i = 0; i < samples; i++) { - analog = analogRead(A0); - if (analog < analog_min) { - analog_min = analog; + if (0 == Settings.adc_param1) { + for (uint32_t i = 0; i < samples; i++) { + analog = analogRead(A0); + if (analog < analog_min) { + analog_min = analog; + } + if (analog > analog_max) { + analog_max = analog; + } + delay(1); } - if (analog > analog_max) { - analog_max = analog; - } - delay(1); + Adc.current = (float)(analog_max-analog_min) * ((float)(Settings.adc_param2) / 100000); } - Adc.current = (float)(analog_max-analog_min) * ((float)(Settings.adc_param2) / 100000); - } - else{ - + else { analog = AdcRead(5); - if(analog>Settings.adc_param1){ + if (analog > Settings.adc_param1) { Adc.current = ((float)(analog) - (float)Settings.adc_param1) * ((float)(Settings.adc_param2) / 100000); } - else{ + else { Adc.current = 0; } } @@ -370,7 +369,7 @@ void CmndAdcParam(void) Settings.adc_param3 = (int)(CharToFloat(subStr(sub_string, XdrvMailbox.data, ",", 4)) * 10000); } if (ADC0_CT_POWER == XdrvMailbox.payload) { - if ((Settings.adc_param1 == 1 & CT_FLAG_ENERGY_RESET) > 0) { + if (((1 == Settings.adc_param1) & CT_FLAG_ENERGY_RESET) > 0) { Adc.energy = 0; Settings.adc_param1 ^= CT_FLAG_ENERGY_RESET; // Cancel energy reset flag } diff --git a/tools/decode-status.py b/tools/decode-status.py index 2450d1fb5..d2d7e2b83 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -126,7 +126,7 @@ a_setoption = [[ "Enable Weekend Energy Tariff", "Select different Modbus registers for Active Energy", "Enable hardware energy total counter as reference", - "Enable HTTP CORS", + "Detach buttons from relays and enable MQTT action state for multipress", "Enable internal pullup for single DS18x20 sensor", "GroupTopic replaces %topic% (0) or fixed topic cmnd/grouptopic (1)", "Enable incrementing bootcount when deepsleep is enabled", @@ -146,7 +146,7 @@ a_setoption = [[ "Distinct MQTT topics per device for Zigbee", "Disable non-json MQTT response", "Enable light fading at start/power on", - "","", + "Set PWM Mode from regular PWM to ColorTemp control","", "","","","", "","","","", "","","","", @@ -241,7 +241,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20200411 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20200428 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj))