My Home-IoT
Find a file
Joe 7963abb27a
Fix BedJet setup priority [fixes esphome/issues#3807] (#4677)
There is a race condition where a BedJet unit previously had its BLE
"notify" flag enabled, and it continues to broadcast these notify
packets even after the ESP32 (and BLEClient) goes away, such as during
a crash or unplugging power.

BLEClient::setup_priority=AFTER_BLUETOOTH, while
BedJetHub::setup_priority=AFTER_WIFI. When the ESP32 starts back up
again, BLEClient::setup() happens first and will start receiving the
BLE notify packets almost immediately. Since we register the BLEClient
child from codegen, BedJetHub is registered as a child already by this
point, so BLEClient dispatches the notify status packet (and other gatt
events) to the BedJetHub handler, even though BedJetHub::setup() has
not been called yet.

We initialize BedJetHub::codec_ in setup(), so if BLEClient starts
dispatching gatt events before setup() is called, then codec_ will not
be initialized yet. This causes BedJetHub's gatt notify handler to call
`this->codec_->decode_notify()` on an uninitialized null pointer. Since
invoking a method does not have to dereference the pointer, that method
invocation is allowed; but later trying to access memory on that
instance results in a StoreProhibited panic.

Changing the BedJetHub's setup_priority to BLUETOOTH causes it to be
setup before BLEClient, so that by the time BLEClient starts to receive
BLE packets, BedJetHub is ready to receive them.
2023-04-12 08:33:15 +00:00
.devcontainer VSCode / devcontainer updates (#4647) 2023-04-03 19:44:46 +00:00
.github Update sync-device-classes.yml 2023-03-29 14:02:34 +13:00
.vscode VSCode / devcontainer updates (#4647) 2023-04-03 19:44:46 +00:00
docker Upgrade clang-format to v13 (#4535) 2023-03-20 03:38:41 +00:00
esphome Fix BedJet setup priority [fixes esphome/issues#3807] (#4677) 2023-04-12 08:33:15 +00:00
script VSCode / devcontainer updates (#4647) 2023-04-03 19:44:46 +00:00
tests Add push to talk voice assistant (#4648) 2023-04-11 23:45:10 +00:00
.clang-format Configure clang-format for consistent pointer alignment (#1890) 2021-06-10 12:55:20 +02:00
.clang-tidy Force braces around multi-line statements (#3094) 2022-01-25 08:56:36 +13:00
.coveragerc Unittests for esphome python code (#931) 2020-03-12 14:27:22 -07:00
.dockerignore More VSCode devcontainer improvements (#1934) 2021-06-22 16:37:05 +02:00
.editorconfig YAML linting (#3779) 2022-09-06 15:48:01 +12:00
.gitattributes Fix line endings normalization (#2407) 2021-09-30 18:07:28 +02:00
.gitignore Add Clipping to displaybuffer (#4271) 2023-02-11 09:56:15 +13:00
.pre-commit-config.yaml Bump black from 23.1.0 to 23.3.0 (#4635) 2023-04-04 02:34:36 +00:00
.yamllint YAML linting (#3779) 2022-09-06 15:48:01 +12:00
CODE_OF_CONDUCT.md Update email addresses (#1733) 2021-05-03 11:51:10 +12:00
CODEOWNERS Add push to talk voice assistant (#4648) 2023-04-11 23:45:10 +00:00
CONTRIBUTING.md Lint trailing whitespace (#3230) 2022-02-19 14:46:27 +01:00
LICENSE 🏗 Merge C++ into python codebase (#504) 2019-04-17 12:06:00 +02:00
MANIFEST.in Update Manifest to rmeove unused dashboard files and include .c ethernet drivers (#4459) 2023-02-19 19:12:29 +00:00
platformio.ini Add ESP32-S3 support in NeoPixelBus component (#4114) 2023-03-08 22:35:40 +00:00
pylintrc Bump pylint from 2.13.9 to 2.14.3 (#3589) 2022-06-21 16:27:33 +12:00
pyproject.toml Bump python min to 3.9 (#3871) 2022-10-05 20:09:27 +13:00
pytest.ini Unittests for esphome python code (#931) 2020-03-12 14:27:22 -07:00
README.md Rename master branch to release (#1976) 2021-07-02 15:42:36 +02:00
requirements.txt Bump zeroconf from 0.47.4 to 0.56.0 (#4674) 2023-04-10 22:29:22 +00:00
requirements_optional.txt Bump base image to 3.4.0 (#1879) 2021-06-08 22:03:04 +02:00
requirements_test.txt Bump pytest from 7.2.2 to 7.3.0 (#4673) 2023-04-10 22:29:40 +00:00
sdkconfig.defaults Set ESP32 watchdog to loop task (#2846) 2021-12-02 09:05:42 +13:00
setup.cfg add-black (#1593) 2021-03-07 16:03:16 -03:00
setup.py Bump python min to 3.9 (#3871) 2022-10-05 20:09:27 +13:00

ESPHome Discord Chat GitHub release

ESPHome Logo

Documentation: https://esphome.io/

For issues, please go to the issue tracker.

For feature requests, please see feature requests.