Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 704ad67

Browse files
authored
Ensure hue tests add config entry before updating it (home-assistant#110428)
1 parent a51ecd0 commit 704ad67

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎tests/components/hue/test_light_v1.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ async def setup_bridge(hass: HomeAssistant, mock_bridge_v1):
178178
"""Load the Hue light platform with the provided bridge."""
179179
hass.config.components.add(hue.DOMAIN)
180180
config_entry = create_config_entry()
181+
config_entry.add_to_hass(hass)
181182
hass.config_entries.async_update_entry(
182183
config_entry, options={CONF_ALLOW_HUE_GROUPS: True}
183184
)
184-
config_entry.add_to_hass(hass)
185185
config_entry.mock_state(hass, ConfigEntryState.LOADED)
186186
mock_bridge_v1.config_entry = config_entry
187187
hass.data[hue.DOMAIN] = {config_entry.entry_id: mock_bridge_v1}

‎tests/components/hue/test_migration.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ async def test_migrate_api_key(hass: HomeAssistant) -> None:
1414
domain=hue.DOMAIN,
1515
data={"host": "0.0.0.0", "api_version": 2, "username": "abcdefgh"},
1616
)
17+
config_entry.add_to_hass(hass)
1718
await hue.migration.check_migration(hass, config_entry)
1819
# the username property should have been migrated to api_key
1920
assert config_entry.data == {
@@ -29,6 +30,7 @@ async def test_auto_switchover(hass: HomeAssistant) -> None:
2930
domain=hue.DOMAIN,
3031
data={"host": "0.0.0.0", "api_version": 1, "username": "abcdefgh"},
3132
)
33+
config_entry.add_to_hass(hass)
3234

3335
with patch.object(hue.migration, "is_v2_bridge", retun_value=True), patch.object(
3436
hue.migration, "handle_v2_migration"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /