Compare commits

...

7 Commits

Author SHA1 Message Date
  Maurice Makaay f26b72386b Fixed wrong formatting of link in Changelog 2 years ago
  Maurice Makaay d8e9688e9e Add ESPHome version check, to require ESPHome 2022.12.0 or later 2 years ago
  Maurice Makaay 1355f7931c Validate correct version of ESPHome 2 years ago
  Maurice Makaay 73d081b269 Re-enable bugfix for core-dev.yaml 2 years ago
  Maurice Makaay 4b02f20f9e Remove bugfix from core-dev.yaml 2 years ago
  Maurice Makaay 91c7962831 Brought fix for issue #104 in line with backport 2 years ago
  Maurice Makaay 15f4ed5bf9 Update refs for release 2 years ago
6 changed files with 59 additions and 45 deletions
Split View
  1. +9
    -9
      CHANGELOG.md
  2. +39
    -23
      components/xiaomi_bslamp2/__init__.py
  3. +7
    -3
      doc/release_plan.md
  4. +1
    -1
      example.yaml
  5. +0
    -4
      packages/core-dev.yaml
  6. +3
    -5
      packages/core.yaml

+ 9
- 9
CHANGELOG.md View File

@ -8,19 +8,19 @@ 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:
[https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104#issuecomment-1356182034](Fix recipe from issue #104)
**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:
[Fix recipe from issue #104](https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104#issuecomment-1356182034)
## [2021.10.0]


+ 39
- 23
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,29 +42,43 @@ FRONT_PANEL_LED_OPTIONS = {
"10": FrontPanelLEDs.LED_10,
}
CONFIG_SCHEMA = cv.COMPONENT_SCHEMA.extend({
# RGBWW Light
cv.Required(CONF_LIGHT): cv.Schema(
{
cv.GenerateID(CONF_LIGHT_HAL_ID): cv.declare_id(LightHAL),
cv.Required(CONF_RED): cv.use_id(LEDCOutput),
cv.Required(CONF_GREEN): cv.use_id(LEDCOutput),
cv.Required(CONF_BLUE): cv.use_id(LEDCOutput),
cv.Required(CONF_WHITE): cv.use_id(LEDCOutput),
cv.Required(CONF_MASTER1): cv.use_id(GPIOBinaryOutput),
cv.Required(CONF_MASTER2): cv.use_id(GPIOBinaryOutput),
}
),
# Front panel I2C
cv.Required(CONF_FRONT_PANEL): cv.Schema(
{
cv.GenerateID(CONF_FRONT_PANEL_HAL_ID): cv.declare_id(FrontPanelHAL),
cv.Required(CONF_I2C): cv.use_id(I2CBus),
cv.Required(CONF_ADDRESS): cv.i2c_address,
cv.Required(CONF_TRIGGER_PIN): cv.All(pins.internal_gpio_input_pin_schema)
}
),
})
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(
check_version_compatibility,
cv.COMPONENT_SCHEMA.extend({
# RGBWW Light
cv.Required(CONF_LIGHT): cv.Schema(
{
cv.GenerateID(CONF_LIGHT_HAL_ID): cv.declare_id(LightHAL),
cv.Required(CONF_RED): cv.use_id(LEDCOutput),
cv.Required(CONF_GREEN): cv.use_id(LEDCOutput),
cv.Required(CONF_BLUE): cv.use_id(LEDCOutput),
cv.Required(CONF_WHITE): cv.use_id(LEDCOutput),
cv.Required(CONF_MASTER1): cv.use_id(GPIOBinaryOutput),
cv.Required(CONF_MASTER2): cv.use_id(GPIOBinaryOutput),
}
),
# Front panel I2C
cv.Required(CONF_FRONT_PANEL): cv.Schema(
{
cv.GenerateID(CONF_FRONT_PANEL_HAL_ID): cv.declare_id(FrontPanelHAL),
cv.Required(CONF_I2C): cv.use_id(I2CBus),
cv.Required(CONF_ADDRESS): cv.i2c_address,
cv.Required(CONF_TRIGGER_PIN): cv.All(pins.internal_gpio_input_pin_schema)
}
),
})
)
async def make_light_hal(config):
light_hal = cg.new_Pvariable(config[CONF_LIGHT][CONF_LIGHT_HAL_ID])


+ 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**


+ 1
- 1
example.yaml View File

@ -32,7 +32,7 @@ substitutions:
packages:
bslamp2:
url: https://github.com/mmakaay/esphome-xiaomi_bslamp2
ref: dev
ref: release/2022.12.0
files:
- packages/core.yaml
- packages/behavior_default.yaml


+ 0
- 4
packages/core-dev.yaml View File

@ -34,10 +34,6 @@ esp32:
CONFIG_FREERTOS_UNICORE: y
advanced:
ignore_efuse_mac_crc: true
# Bugfix for ESPHome 2022.12.0 and up: fallback to older platform
# version, to prevent bricked devices. ESPHome uses newer versions
# by default.
# See also: https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104
version: 4.3.2
source: ~3.40302.0
platform_version: platformio/espressif32 @ 3.5.0


+ 3
- 5
packages/core.yaml View File

@ -25,10 +25,8 @@ esp32:
CONFIG_FREERTOS_UNICORE: y
advanced:
ignore_efuse_mac_crc: true
# Bugfix for ESPHome 2022.12.0 and up: fallback to older platform
# version, to prevent bricked devices. ESPHome uses newer versions
# by default.
# See also: https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104
# Work-around for bricking-after-upgrade-to-2022-12-0-issue.
# See: https://github.com/mmakaay/esphome-xiaomi_bslamp2/issues/104
version: 4.3.2
source: ~3.40302.0
platform_version: platformio/espressif32 @ 3.5.0
@ -38,7 +36,7 @@ external_components:
- source:
type: git
url: https://github.com/mmakaay/esphome-xiaomi_bslamp2
ref: dev
ref: release/2022.12.0
refresh: 60s
# Disable the reboot timeout. By default, the lamp reboots after 15


Loading…
Cancel
Save