Skip to content

Fix template light returning NULL in color or temperature#33498

Merged
bdraco merged 7 commits intohome-assistant:devfrom
alistairg:template-light
Apr 2, 2020
Merged

Fix template light returning NULL in color or temperature#33498
bdraco merged 7 commits intohome-assistant:devfrom
alistairg:template-light

Conversation

@alistairg
Copy link
Copy Markdown
Contributor

Proposed change

Color and/or white temperature lights may sometimes return "None" from their respective hs_color and color_temp attributes. This pull adds support for this, and eliminates exceptions that may have previously been returned when an attribute is, correctly, set to null.

Type of change

  • Dependency upgrade
  • [X ] Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • [X ] The code change is tested and works locally.
  • [X ] Local tests pass. Your PR cannot be merged unless tests pass
  • [X ] There is no commented out code in this PR.
  • [X ] I have followed the development checklist
  • [X ] The code has been formatted using Black (black --fast homeassistant tests)
  • [X ] Tests have been added to verify that the new code works.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @PhracturedBlue, @tetienne, mind taking a look at this pull request as its been labeled with a integration (template) you are listed as a codeowner for? Thanks!

Comment thread homeassistant/components/template/light.py Outdated
Comment thread homeassistant/components/template/light.py
Comment thread homeassistant/components/template/light.py
Comment thread homeassistant/components/template/light.py
@MartinHjelmare MartinHjelmare changed the title Support for returning NULL in color or temperature. Fixes #33469 Fix template light returning NULL in color or temperature Apr 2, 2020
Comment thread homeassistant/components/template/light.py
Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Ok to merge when last comment addressed

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 2, 2020

CI Failure was fixed by #33553

@bdraco bdraco merged commit 3db9d6a into home-assistant:dev Apr 2, 2020
@lock lock Bot locked and limited conversation to collaborators Apr 4, 2020
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.

Cannot return NULL from template for color_temp or hs_color in template light

6 participants