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
4d27a329
Unverified
Commit
4d27a329
authored
3 months ago
by
Robert Resch
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated cover constants (#131797)
parent
c5f68bcc
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/cover/__init__.py
+1
-50
1 addition, 50 deletions
homeassistant/components/cover/__init__.py
tests/components/cover/test_init.py
+1
-21
1 addition, 21 deletions
tests/components/cover/test_init.py
with
2 additions
and
71 deletions
homeassistant/components/cover/__init__.py
+
1
−
50
View file @
4d27a329
...
...
@@ -89,36 +89,8 @@ class CoverDeviceClass(StrEnum):
DEVICE_CLASSES_SCHEMA
=
vol
.
All
(
vol
.
Lower
,
vol
.
Coerce
(
CoverDeviceClass
))
# DEVICE_CLASS* below are deprecated as of 2021.12
# use the CoverDeviceClass enum instead.
DEVICE_CLASSES
=
[
cls
.
value
for
cls
in
CoverDeviceClass
]
_DEPRECATED_DEVICE_CLASS_AWNING
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
AWNING
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_BLIND
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
BLIND
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_CURTAIN
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
CURTAIN
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_DAMPER
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
DAMPER
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_DOOR
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
DOOR
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_GARAGE
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
GARAGE
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_GATE
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
GATE
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_SHADE
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
SHADE
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_SHUTTER
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
SHUTTER
,
"
2025.1
"
)
_DEPRECATED_DEVICE_CLASS_WINDOW
=
DeprecatedConstantEnum
(
CoverDeviceClass
.
WINDOW
,
"
2025.1
"
)
# mypy: disallow-any-generics
...
...
@@ -136,27 +108,6 @@ class CoverEntityFeature(IntFlag):
SET_TILT_POSITION
=
128
# These SUPPORT_* constants are deprecated as of Home Assistant 2022.5.
# Please use the CoverEntityFeature enum instead.
_DEPRECATED_SUPPORT_OPEN
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
OPEN
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_CLOSE
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
CLOSE
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_SET_POSITION
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
SET_POSITION
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_STOP
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
STOP
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_OPEN_TILT
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
OPEN_TILT
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_CLOSE_TILT
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
CLOSE_TILT
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_STOP_TILT
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
STOP_TILT
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_SET_TILT_POSITION
=
DeprecatedConstantEnum
(
CoverEntityFeature
.
SET_TILT_POSITION
,
"
2025.1
"
)
ATTR_CURRENT_POSITION
=
"
current_position
"
ATTR_CURRENT_TILT_POSITION
=
"
current_tilt_position
"
ATTR_POSITION
=
"
position
"
...
...
This diff is collapsed.
Click to expand it.
tests/components/cover/test_init.py
+
1
−
21
View file @
4d27a329
...
...
@@ -13,11 +13,7 @@ from homeassistant.setup import async_setup_component
from
.common
import
MockCover
from
tests.common
import
(
help_test_all
,
import_and_test_deprecated_constant_enum
,
setup_test_component_platform
,
)
from
tests.common
import
help_test_all
,
setup_test_component_platform
async
def
test_services
(
...
...
@@ -161,22 +157,6 @@ def test_all() -> None:
help_test_all
(
cover
)
@pytest.mark.parametrize
(
(
"
enum
"
,
"
constant_prefix
"
),
_create_tuples
(
cover
.
CoverEntityFeature
,
"
SUPPORT_
"
)
+
_create_tuples
(
cover
.
CoverDeviceClass
,
"
DEVICE_CLASS_
"
),
)
def
test_deprecated_constants
(
caplog
:
pytest
.
LogCaptureFixture
,
enum
:
Enum
,
constant_prefix
:
str
,
)
->
None
:
"""
Test deprecated constants.
"""
import_and_test_deprecated_constant_enum
(
caplog
,
cover
,
enum
,
constant_prefix
,
"
2025.1
"
)
def
test_deprecated_supported_features_ints
(
caplog
:
pytest
.
LogCaptureFixture
)
->
None
:
"""
Test deprecated supported features ints.
"""
...
...
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