Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ID to OTA to allow extension for overrides #296

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Conversation

notjj
Copy link
Contributor

@notjj notjj commented Jun 26, 2024

Due to how esphome handles inheritance, merging and replacing in packages[link], having ota: as part of the base package will override any changes a user may make in their own config.

So in the case of ota: if you have a password defined as below in their local config:

ota:
  - platform: esphome
     password: "***"

They will no longer be able to update as the package will overwrite the entire ota: section with what is in the base config, and result in the following error:

INFO Uploading /data/build/left-garage-door/.pioenvs/left-garage-door/firmware.bin (620640 bytes)
INFO Compressed to 417852 bytes
ERROR ESP requests password, but no password given!

So the option is either disable the OTA password by plugging the device in to flash, or add an ID to allow !extend to work on the OTA settings.

With an ID added, a user can use !extend in their config to add additional settings, such as password

ota:
  - id: !extend ratgdo_ota
    password: "...."

Hopefully this is just a short-term fix and esphome makes some changes upstream to resolve this... as the !extend function isn't commonly used (there is an issue open for it currently, but only 5hrs old).

Currently package yaml will override any settings, this allows you to do the following to add password, etc:

ota:
  id: !extend ratgdo_ota
  password: "...."
@bdraco
Copy link
Member

bdraco commented Jun 26, 2024

Thanks @notjj

@bdraco bdraco merged commit a90b6fb into ratgdo:main Jun 26, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants