Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
a67b6c5b
Unverified
Commit
a67b6c5b
authored
8 months ago
by
J. Nick Koston
Committed by
GitHub
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid recording additional light attributes (#121776)
parent
8a52ffb9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/light/__init__.py
+10
-0
10 additions, 0 deletions
homeassistant/components/light/__init__.py
tests/components/light/test_recorder.py
+22
-1
22 additions, 1 deletion
tests/components/light/test_recorder.py
with
32 additions
and
1 deletion
homeassistant/components/light/__init__.py
+
10
−
0
View file @
a67b6c5b
...
...
@@ -864,6 +864,16 @@ class LightEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
ATTR_MAX_MIREDS
,
ATTR_MIN_COLOR_TEMP_KELVIN
,
ATTR_MAX_COLOR_TEMP_KELVIN
,
ATTR_BRIGHTNESS
,
ATTR_COLOR_MODE
,
ATTR_COLOR_TEMP
,
ATTR_COLOR_TEMP_KELVIN
,
ATTR_EFFECT
,
ATTR_HS_COLOR
,
ATTR_RGB_COLOR
,
ATTR_RGBW_COLOR
,
ATTR_RGBWW_COLOR
,
ATTR_XY_COLOR
,
}
)
...
...
This diff is collapsed.
Click to expand it.
tests/components/light/test_recorder.py
+
22
−
1
View file @
a67b6c5b
...
...
@@ -9,12 +9,23 @@ import pytest
from
homeassistant.components
import
light
from
homeassistant.components.light
import
(
ATTR_BRIGHTNESS
,
ATTR_COLOR_MODE
,
ATTR_COLOR_TEMP
,
ATTR_COLOR_TEMP_KELVIN
,
ATTR_EFFECT
,
ATTR_EFFECT_LIST
,
ATTR_HS_COLOR
,
ATTR_MAX_COLOR_TEMP_KELVIN
,
ATTR_MAX_MIREDS
,
ATTR_MIN_COLOR_TEMP_KELVIN
,
ATTR_MIN_MIREDS
,
ATTR_RGB_COLOR
,
ATTR_RGBW_COLOR
,
ATTR_RGBWW_COLOR
,
ATTR_SUPPORTED_COLOR_MODES
,
ATTR_XY_COLOR
,
DOMAIN
,
)
from
homeassistant.components.recorder
import
Recorder
from
homeassistant.components.recorder.history
import
get_significant_states
...
...
@@ -50,7 +61,7 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant)
await
async_wait_recording_done
(
hass
)
states
=
await
hass
.
async_add_executor_job
(
get_significant_states
,
hass
,
now
,
None
,
hass
.
states
.
async_entity_ids
()
get_significant_states
,
hass
,
now
,
None
,
hass
.
states
.
async_entity_ids
(
DOMAIN
)
)
assert
len
(
states
)
>=
1
for
entity_states
in
states
.
values
():
...
...
@@ -62,3 +73,13 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant)
assert
ATTR_FRIENDLY_NAME
in
state
.
attributes
assert
ATTR_MAX_COLOR_TEMP_KELVIN
not
in
state
.
attributes
assert
ATTR_MIN_COLOR_TEMP_KELVIN
not
in
state
.
attributes
assert
ATTR_BRIGHTNESS
not
in
state
.
attributes
assert
ATTR_COLOR_MODE
not
in
state
.
attributes
assert
ATTR_COLOR_TEMP
not
in
state
.
attributes
assert
ATTR_COLOR_TEMP_KELVIN
not
in
state
.
attributes
assert
ATTR_EFFECT
not
in
state
.
attributes
assert
ATTR_HS_COLOR
not
in
state
.
attributes
assert
ATTR_RGB_COLOR
not
in
state
.
attributes
assert
ATTR_RGBW_COLOR
not
in
state
.
attributes
assert
ATTR_RGBWW_COLOR
not
in
state
.
attributes
assert
ATTR_XY_COLOR
not
in
state
.
attributes
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment