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

Introduce encode_value/decode_value() template functions #2662

Merged
merged 7 commits into from
Nov 10, 2021

Conversation

oxan
Copy link
Member

@oxan oxan commented Nov 3, 2021

What does this implement/fix?

Part of a series to clean-up helpers.h. This one is preparation for cleaning up the hexadecimal formatting/parsing helpers.

Intorudce the encode_value and decode_value template functions, as more generic versions of the pre-existing encode_uint16/encode_uint32/decode_uint16. Drop decode_uint16 and convert its user, as it's now equivalent to decode_value.

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

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:

@probot-esphome
Copy link

probot-esphome bot commented Nov 3, 2021

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

esphome/core/helpers.h Outdated Show resolved Hide resolved
esphome/core/helpers.h Outdated Show resolved Hide resolved
esphome/core/helpers.h Outdated Show resolved Hide resolved
@oxan oxan merged commit 99c775d into esphome:dev Nov 10, 2021
@oxan oxan deleted the helpers/encode-decode branch November 10, 2021 18:44
@jesserockz jesserockz mentioned this pull request Nov 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants