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
de4540c6
Unverified
Commit
de4540c6
authored
4 weeks ago
by
mvn23
Committed by
GitHub
4 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated entity migration from opentherm_gw (#139641)
parent
d006d33d
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/opentherm_gw/__init__.py
+1
-18
1 addition, 18 deletions
homeassistant/components/opentherm_gw/__init__.py
tests/components/opentherm_gw/test_init.py
+1
-28
1 addition, 28 deletions
tests/components/opentherm_gw/test_init.py
with
2 additions
and
46 deletions
homeassistant/components/opentherm_gw/__init__.py
+
1
−
18
View file @
de4540c6
...
@@ -9,7 +9,6 @@ import pyotgw.vars as gw_vars
...
@@ -9,7 +9,6 @@ import pyotgw.vars as gw_vars
from
serial
import
SerialException
from
serial
import
SerialException
import
voluptuous
as
vol
import
voluptuous
as
vol
from
homeassistant.components.climate
import
DOMAIN
as
CLIMATE_DOMAIN
from
homeassistant.config_entries
import
ConfigEntry
from
homeassistant.config_entries
import
ConfigEntry
from
homeassistant.const
import
(
from
homeassistant.const
import
(
ATTR_DATE
,
ATTR_DATE
,
...
@@ -25,11 +24,7 @@ from homeassistant.const import (
...
@@ -25,11 +24,7 @@ from homeassistant.const import (
)
)
from
homeassistant.core
import
HomeAssistant
,
ServiceCall
from
homeassistant.core
import
HomeAssistant
,
ServiceCall
from
homeassistant.exceptions
import
ConfigEntryNotReady
from
homeassistant.exceptions
import
ConfigEntryNotReady
from
homeassistant.helpers
import
(
from
homeassistant.helpers
import
config_validation
as
cv
,
device_registry
as
dr
config_validation
as
cv
,
device_registry
as
dr
,
entity_registry
as
er
,
)
from
homeassistant.helpers.dispatcher
import
async_dispatcher_send
from
homeassistant.helpers.dispatcher
import
async_dispatcher_send
from
.const
import
(
from
.const
import
(
...
@@ -87,18 +82,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
...
@@ -87,18 +82,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
gateway
=
OpenThermGatewayHub
(
hass
,
config_entry
)
gateway
=
OpenThermGatewayHub
(
hass
,
config_entry
)
hass
.
data
[
DATA_OPENTHERM_GW
][
DATA_GATEWAYS
][
config_entry
.
data
[
CONF_ID
]]
=
gateway
hass
.
data
[
DATA_OPENTHERM_GW
][
DATA_GATEWAYS
][
config_entry
.
data
[
CONF_ID
]]
=
gateway
# Migration can be removed in 2025.4.0
ent_reg
=
er
.
async_get
(
hass
)
if
(
entity_id
:
=
ent_reg
.
async_get_entity_id
(
CLIMATE_DOMAIN
,
DOMAIN
,
config_entry
.
data
[
CONF_ID
]
)
)
is
not
None
:
ent_reg
.
async_update_entity
(
entity_id
,
new_unique_id
=
f
"
{
config_entry
.
data
[
CONF_ID
]
}
-
{
OpenThermDeviceIdentifier
.
THERMOSTAT
}
-thermostat_entity
"
,
)
config_entry
.
add_update_listener
(
options_updated
)
config_entry
.
add_update_listener
(
options_updated
)
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
tests/components/opentherm_gw/test_init.py
+
1
−
28
View file @
de4540c6
...
@@ -8,9 +8,8 @@ from homeassistant.components.opentherm_gw.const import (
...
@@ -8,9 +8,8 @@ from homeassistant.components.opentherm_gw.const import (
DOMAIN
,
DOMAIN
,
OpenThermDeviceIdentifier
,
OpenThermDeviceIdentifier
,
)
)
from
homeassistant.const
import
CONF_ID
from
homeassistant.core
import
HomeAssistant
from
homeassistant.core
import
HomeAssistant
from
homeassistant.helpers
import
device_registry
as
dr
,
entity_registry
as
er
from
homeassistant.helpers
import
device_registry
as
dr
from
.conftest
import
MOCK_GATEWAY_ID
,
VERSION_TEST
from
.conftest
import
MOCK_GATEWAY_ID
,
VERSION_TEST
...
@@ -69,29 +68,3 @@ async def test_device_registry_update(
...
@@ -69,29 +68,3 @@ async def test_device_registry_update(
)
)
assert
gw_dev
is
not
None
assert
gw_dev
is
not
None
assert
gw_dev
.
sw_version
==
VERSION_NEW
assert
gw_dev
.
sw_version
==
VERSION_NEW
# Entity migration test can be removed in 2025.4.0
async
def
test_climate_entity_migration
(
hass
:
HomeAssistant
,
entity_registry
:
er
.
EntityRegistry
,
mock_config_entry
:
MockConfigEntry
,
mock_pyotgw
:
MagicMock
,
)
->
None
:
"""
Test that the climate entity unique_id gets migrated correctly.
"""
mock_config_entry
.
add_to_hass
(
hass
)
entry
=
entity_registry
.
async_get_or_create
(
domain
=
"
climate
"
,
platform
=
"
opentherm_gw
"
,
unique_id
=
mock_config_entry
.
data
[
CONF_ID
],
)
await
hass
.
config_entries
.
async_setup
(
mock_config_entry
.
entry_id
)
await
hass
.
async_block_till_done
()
updated_entry
=
entity_registry
.
async_get
(
entry
.
entity_id
)
assert
updated_entry
is
not
None
assert
(
updated_entry
.
unique_id
==
f
"
{
mock_config_entry
.
data
[
CONF_ID
]
}
-
{
OpenThermDeviceIdentifier
.
THERMOSTAT
}
-thermostat_entity
"
)
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