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

Store preferences in disk file on host platform #6428

Merged
merged 7 commits into from Mar 25, 2024

Conversation

clydebarrow
Copy link
Contributor

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • host

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

nagyrobi and others added 6 commits March 22, 2024 21:00
30 chars get used very quickly when the user uses a few special characters in the version string. 

Eg. `Gázkazán 1-2-4 PID vezérlés` requires double amount of chars: `G\303\241zkaz\303\241n 1-2-4 PID vez\303\251rl\303\251s`.
Use hash to compare project versions.
@clydebarrow clydebarrow requested a review from a team as a code owner March 25, 2024 10:35
@probot-esphome
Copy link

Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration (host) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

fs::create_directories(this->filename_);
this->filename_.append("/");
this->filename_.append(App.get_name());
this->filename_.append(".json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the below code, this file is binary, not json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. JSON seemed like a Good Idea (which in Python it would have been) then I decided that was over-engineering.

@jesserockz jesserockz merged commit 121bd84 into esphome:dev Mar 25, 2024
53 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
@clydebarrow clydebarrow deleted the hostpref branch April 24, 2024 00:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants