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

Migrate COLOR constants to Color class & disallow implicit conversions to Color #2093

Merged
merged 3 commits into from Aug 3, 2021

Conversation

oxan
Copy link
Member

@oxan oxan commented Jul 29, 2021

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
  • 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:

oxan and others added 3 commits July 29, 2021 17:14
Add explicit to Color::Color(uint32_t) ctor so that implicit conversions
from various integer types to Color are not allowed, which may happen
within e.g. Color::fade_to_black(uint8_t).

Co-authored-by: Xo Wang <xo@geekshavefeelings.com>
According to the docs this type alias was already deprecated (and it is
unused by ESPHome itself), so now the compiler will warn as well.
@probot-esphome
Copy link

Hey there @kbx81, mind taking a look at this pull request as its been labeled with an integration (ssd1331_base) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

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

LGTM 👍

ESPHome Dev automation moved this from Needs Review to Reviewer Approved Aug 1, 2021
@jesserockz jesserockz merged commit 441d5bd into esphome:dev Aug 3, 2021
ESPHome Dev automation moved this from Reviewer Approved to Done Aug 3, 2021
@oxan oxan deleted the submitted/color-class-fixes branch August 3, 2021 22:10
This was referenced Aug 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
ESPHome Dev automation moved this from Done to Reviewer Approved Sep 23, 2023
ESPHome Dev automation moved this from Reviewer Approved to Done Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.