From b149443691b049210c7cde75a2e9d9135a251cb0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:35:22 +0200 Subject: [PATCH] Fix default battery level - Fix default battery level (#19160) - Bump version to v13.0.0.3 --- CHANGELOG.md | 28 +++++++++++-------- RELEASENOTES.md | 10 ++++++- tasmota/include/tasmota_version.h | 2 +- tasmota/tasmota_support/settings.ino | 3 ++ tasmota/tasmota_support/support_tasmota.ino | 10 +++---- .../tasmota_xdrv_driver/xdrv_12_discovery.ino | 4 +-- 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d159e8be4..db42b7baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,28 +3,34 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [13.0.0.2] +## [13.0.0.3] +### Added + +### Breaking Changed + +### Changed + +### Fixed +- Initial battery level percentage (#19160) + +### Removed + +## [13.0.0.2] 20230721 ### Added - Partition Wizard is now able to convert to safeboot from Shelly partition layout (#19034) - Matter mini-profiler (#19075) - Berry `_class` can be used in `static var` initialization code (#19088) -- Berry add `energy.update_total()` to call `EnergyUpdateTotal()` from energy driver -- Berry add metrics for memory allocation/deallocation/reallocation +- Berry `energy.update_total()` to call `EnergyUpdateTotal()` from energy driver +- Berry metrics for memory allocation/deallocation/reallocation - Berry `tasmota.loglevel()` and `tasmota.rtc_utc()` for faster performance -- Berry add AES CCM decrypting in a single call to avoid any object allocation - -### Breaking Changed +- Berry AES CCM decrypting in a single call to avoid any object allocation ### Changed - ESP32 shutter driver support up to 16 shutters (#18295) - Configuration backup and restore now backup and restore ``.xdrvsetXXX`` files too (#18295) - Berry extend `range(lower, upper, incr)` to arbitrary increment - Berry updated syntax highlighting plugin for VSCode -- Matter latency improvement for single attribute reads and single commands - -### Fixed - -### Removed +- Matter latency improvement for single attribute reads and single commands (#19158) ## [13.0.0.1] 20230708 ### Added diff --git a/RELEASENOTES.md b/RELEASENOTES.md index abaf0b4fd..32031066a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -110,7 +110,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v13.0.0.2 +## Changelog v13.0.0.3 ### Added - Command ``BrRestart`` to restart the Berry VM (experimental) [#19003](https://github.com/arendst/Tasmota/issues/19003) - Command ``Delay -1`` to wait until next second [#18984](https://github.com/arendst/Tasmota/issues/18984) @@ -118,6 +118,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Support for SGP41 TVOC/NOx Sensor [#18880](https://github.com/arendst/Tasmota/issues/18880) - Berry `getgbl` performance counter to `debug.counters()` [#19070](https://github.com/arendst/Tasmota/issues/19070) - Berry `_class` can be used in `static var` initialization code [#19088](https://github.com/arendst/Tasmota/issues/19088) +- Berry `energy.update_total()` to call `EnergyUpdateTotal()` from energy driver +- Berry metrics for memory allocation/deallocation/reallocation +- Berry `tasmota.loglevel()` and `tasmota.rtc_utc()` for faster performance +- Berry AES CCM decrypting in a single call to avoid any object allocation - Partition Wizard is now able to convert to safeboot from Shelly partition layout [#19034](https://github.com/arendst/Tasmota/issues/19034) - Matter option to disable bridge mode [#18992](https://github.com/arendst/Tasmota/issues/18992) - Matter mini-profiler [#19075](https://github.com/arendst/Tasmota/issues/19075) @@ -130,9 +134,13 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - ESP32 LVGL library from v8.3.7 to v8.3.8 (no functional change) - Configuration backup and restore now backup and restore ``.xdrvsetXXX`` files too [#18295](https://github.com/arendst/Tasmota/issues/18295) - ESP32 shutter driver support up to 16 shutters [#18295](https://github.com/arendst/Tasmota/issues/18295) +- Berry extend `range(lower, upper, incr)` to arbitrary increment +- Berry updated syntax highlighting plugin for VSCode - Matter support for temperature in Fahrenheit (`SetOption8 1`) [#18987](https://github.com/arendst/Tasmota/issues/18987) - Matter improve responsiveness [#19002](https://github.com/arendst/Tasmota/issues/19002) - Matter improve latency for remote commands [#19072](https://github.com/arendst/Tasmota/issues/19072) +- Matter improve latency for single attribute reads and single commands [#19158](https://github.com/arendst/Tasmota/issues/19072) + ### Fixed - Berry Walrus Operator [#18982](https://github.com/arendst/Tasmota/issues/18982) diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 6dfd360a2..8350c6860 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x0D000002; // 13.0.0.2 +const uint32_t VERSION = 0x0D000003; // 13.0.0.2 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index d1a75ff7f..445940865 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1741,6 +1741,9 @@ void SettingsDelta(void) { RtcSettings.energy_usage.last_usage_kWhtotal /= 100; #endif } + if (Settings->version < 0x0D000003) { // 13.0.0.3 + Settings->battery_level_percent = 101; + } Settings->version = VERSION; SettingsSave(1); diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index c035f77ca..4daeb4571 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -829,12 +829,10 @@ void MqttShowState(void) ResponseAppendTime(); ResponseAppend_P(PSTR(",\"" D_JSON_UPTIME "\":\"%s\",\"UptimeSec\":%u"), GetUptime().c_str(), UpTime()); - -// Battery Level expliciet for deepsleep devices -if (Settings->battery_level_percent != 101) { - ResponseAppend_P(PSTR(",\"" D_CMND_ZIGBEE_BATTPERCENT "\":%d"), Settings->battery_level_percent); -} - + // Battery Level expliciet for deepsleep devices + if (Settings->battery_level_percent != 101) { + ResponseAppend_P(PSTR(",\"" D_CMND_ZIGBEE_BATTPERCENT "\":%d"), Settings->battery_level_percent); + } #ifdef ESP8266 #ifdef USE_ADC_VCC diff --git a/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino b/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino index f5fa3a3f7..f71a19b8d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_12_discovery.ino @@ -201,8 +201,8 @@ void TasDiscoverMessage(void) { Settings->flag5.fade_fixed_duration, light_controller_isCTRGBLinked, light_subtype, - Settings->battery_level_percent==101?0:1, - Settings->deepsleep==0?0:1 + (Settings->battery_level_percent == 101) ? 0 : 1, + (Settings->deepsleep == 0) ? 0 : 1 ); for (uint32_t i = 0; i < TasmotaGlobal.shutters_present; i++) {