Browse Source

Add ESPHome version check, to require ESPHome 2022.12.0 or later

release/2022.12.0
Maurice Makaay 2 years ago
parent
commit
d8e9688e9e
3 changed files with 29 additions and 12 deletions
  1. +8
    -8
      CHANGELOG.md
  2. +14
    -1
      components/xiaomi_bslamp2/__init__.py
  3. +7
    -3
      doc/release_plan.md

+ 8
- 8
CHANGELOG.md View File

@ -8,18 +8,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
**Note**: This release requires ESPHome 2022.12.0 and Home Assistant 2021.8.0 or newer.
### Changed
### Fixed
- Due to changes in the ESP-IDF framework, and ESPHome 2022.12.0 using the newer version
of the framework, flashing the lamp with ESPHome 2022.12.0 could result in a
failing device. It would not connect to WiFi anymore and serial logging showed a reboot
loop, crashing at the WiFi setup.
of the framework, upgrading the lamp from ESPHome version 2022.11.0 to 2022.12.0 could
result in a failing device. It would not connect to WiFi anymore and serial logging
showed a reboot loop, crashing at the WiFi setup.
This release of the lamp firmware forces the use of the last known working version
of the ESP-IDF framework. This is not a final solution, because I don't want to be
stuck to old versions for dependencies, but for now this change at least should fix
the issue for users that flash their lamps.
stuck to old versions for dependencies, but for now this change at least prevents
issues for users that flash their lamps.
**If you already flashed your lamp and it ended up bricked**, then check out this
information from the related GitHub issue report:
**If you already flashed your lamp and it ended up bricked, then no worries!**
Things can be fixed. Check out this information from the related GitHub issue report:
[https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104#issuecomment-1356182034](Fix recipe from issue #104)
## [2021.10.0]


+ 14
- 1
components/xiaomi_bslamp2/__init__.py View File

@ -8,6 +8,8 @@ from esphome.const import (
CONF_LIGHT, CONF_RED, CONF_GREEN, CONF_BLUE, CONF_WHITE,
CONF_I2C, CONF_ADDRESS, CONF_TRIGGER_PIN, CONF_ID
)
from esphome.util import parse_esphome_version
from voluptuous import Invalid
CODEOWNERS = ["@mmakaay"]
@ -40,8 +42,19 @@ FRONT_PANEL_LED_OPTIONS = {
"10": FrontPanelLEDs.LED_10,
}
def check_version_compatibility(config):
esphome_version = parse_esphome_version()
if esphome_version < (2022, 12, 0):
raise Invalid(
"This xiaomi_bslamp2 component requires at least ESPHome " +
"version 2022.12.0; Please upgrade ESPHome and try again."
)
return config
CONFIG_SCHEMA = cv.All(
cv.require_esphome_version(2022, 12, 0),
check_version_compatibility,
cv.COMPONENT_SCHEMA.extend({
# RGBWW Light
cv.Required(CONF_LIGHT): cv.Schema(


+ 7
- 3
doc/release_plan.md View File

@ -11,9 +11,13 @@ Make sure all notable changes are recorded in the changelog.
The minimum ESPHome version requirement must be documented correctly in the following files:
* doc/installation.md (at the start of the file)
* README.md (at the start of the quick start guide)
* CHANGELOG.md (at the start of the log for the released version)
* `doc/installation.md` (at the start of the file)
* `README.md` (at the start of the quick start guide)
* `CHANGELOG.md` (at the start of the log for the released version)
* `components/xiaomi_bslamp2/__init__.py` in the function
`check_version_compatibility()`. This function can also be used
to check the maximum version of ESPHome that can be used. An example
of this use can be found in the `release/2021.10.0` branch.
**Create version release branch**


Loading…
Cancel
Save