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
c5f68bcc
Unverified
Commit
c5f68bcc
authored
3 months ago
by
Robert Resch
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated remote constants (#131809)
parent
3866176e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/remote/__init__.py
+0
-27
0 additions, 27 deletions
homeassistant/components/remote/__init__.py
tests/components/remote/test_init.py
+1
-19
1 addition, 19 deletions
tests/components/remote/test_init.py
with
1 addition
and
46 deletions
homeassistant/components/remote/__init__.py
+
0
−
27
View file @
c5f68bcc
...
@@ -22,12 +22,6 @@ from homeassistant.const import (
...
@@ -22,12 +22,6 @@ from homeassistant.const import (
)
)
from
homeassistant.core
import
HomeAssistant
from
homeassistant.core
import
HomeAssistant
from
homeassistant.helpers
import
config_validation
as
cv
from
homeassistant.helpers
import
config_validation
as
cv
from
homeassistant.helpers.deprecation
import
(
DeprecatedConstantEnum
,
all_with_deprecated_constants
,
check_if_deprecated_constant
,
dir_with_deprecated_constants
,
)
from
homeassistant.helpers.entity
import
ToggleEntity
,
ToggleEntityDescription
from
homeassistant.helpers.entity
import
ToggleEntity
,
ToggleEntityDescription
from
homeassistant.helpers.entity_component
import
EntityComponent
from
homeassistant.helpers.entity_component
import
EntityComponent
from
homeassistant.helpers.typing
import
ConfigType
from
homeassistant.helpers.typing
import
ConfigType
...
@@ -74,19 +68,6 @@ class RemoteEntityFeature(IntFlag):
...
@@ -74,19 +68,6 @@ class RemoteEntityFeature(IntFlag):
ACTIVITY
=
4
ACTIVITY
=
4
# These SUPPORT_* constants are deprecated as of Home Assistant 2022.5.
# Please use the RemoteEntityFeature enum instead.
_DEPRECATED_SUPPORT_LEARN_COMMAND
=
DeprecatedConstantEnum
(
RemoteEntityFeature
.
LEARN_COMMAND
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_DELETE_COMMAND
=
DeprecatedConstantEnum
(
RemoteEntityFeature
.
DELETE_COMMAND
,
"
2025.1
"
)
_DEPRECATED_SUPPORT_ACTIVITY
=
DeprecatedConstantEnum
(
RemoteEntityFeature
.
ACTIVITY
,
"
2025.1
"
)
REMOTE_SERVICE_ACTIVITY_SCHEMA
=
cv
.
make_entity_service_schema
(
REMOTE_SERVICE_ACTIVITY_SCHEMA
=
cv
.
make_entity_service_schema
(
{
vol
.
Optional
(
ATTR_ACTIVITY
):
cv
.
string
}
{
vol
.
Optional
(
ATTR_ACTIVITY
):
cv
.
string
}
)
)
...
@@ -251,11 +232,3 @@ class RemoteEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_)
...
@@ -251,11 +232,3 @@ class RemoteEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_)
await
self
.
hass
.
async_add_executor_job
(
await
self
.
hass
.
async_add_executor_job
(
ft
.
partial
(
self
.
delete_command
,
**
kwargs
)
ft
.
partial
(
self
.
delete_command
,
**
kwargs
)
)
)
# These can be removed if no deprecated constant are in this module anymore
__getattr__
=
ft
.
partial
(
check_if_deprecated_constant
,
module_globals
=
globals
())
__dir__
=
ft
.
partial
(
dir_with_deprecated_constants
,
module_globals_keys
=
[
*
globals
().
keys
()]
)
__all__
=
all_with_deprecated_constants
(
globals
())
This diff is collapsed.
Click to expand it.
tests/components/remote/test_init.py
+
1
−
19
View file @
c5f68bcc
...
@@ -23,11 +23,7 @@ from homeassistant.const import (
...
@@ -23,11 +23,7 @@ from homeassistant.const import (
)
)
from
homeassistant.core
import
HomeAssistant
from
homeassistant.core
import
HomeAssistant
from
tests.common
import
(
from
tests.common
import
async_mock_service
async_mock_service
,
help_test_all
,
import_and_test_deprecated_constant_enum
,
)
TEST_PLATFORM
=
{
DOMAIN
:
{
CONF_PLATFORM
:
"
test
"
}}
TEST_PLATFORM
=
{
DOMAIN
:
{
CONF_PLATFORM
:
"
test
"
}}
SERVICE_SEND_COMMAND
=
"
send_command
"
SERVICE_SEND_COMMAND
=
"
send_command
"
...
@@ -148,20 +144,6 @@ async def test_delete_command(hass: HomeAssistant) -> None:
...
@@ -148,20 +144,6 @@ async def test_delete_command(hass: HomeAssistant) -> None:
assert
call
.
data
[
ATTR_ENTITY_ID
]
==
ENTITY_ID
assert
call
.
data
[
ATTR_ENTITY_ID
]
==
ENTITY_ID
def
test_all
()
->
None
:
"""
Test module.__all__ is correctly set.
"""
help_test_all
(
remote
)
@pytest.mark.parametrize
((
"
enum
"
),
list
(
remote
.
RemoteEntityFeature
))
def
test_deprecated_constants
(
caplog
:
pytest
.
LogCaptureFixture
,
enum
:
remote
.
RemoteEntityFeature
,
)
->
None
:
"""
Test deprecated constants.
"""
import_and_test_deprecated_constant_enum
(
caplog
,
remote
,
enum
,
"
SUPPORT_
"
,
"
2025.1
"
)
def
test_deprecated_supported_features_ints
(
caplog
:
pytest
.
LogCaptureFixture
)
->
None
:
def
test_deprecated_supported_features_ints
(
caplog
:
pytest
.
LogCaptureFixture
)
->
None
:
"""
Test deprecated supported features ints.
"""
"""
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