Migrate hue to use async_update_entry to alter config entries (#110310)

This commit is contained in:
J. Nick Koston 2024-02-12 13:20:10 -06:00 committed by GitHub
parent 5c7d3035ca
commit cc13d7eec7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -174,13 +174,15 @@ LIGHT_GAMUT = color.GamutType(
LIGHT_GAMUT_TYPE = "A"
async def setup_bridge(hass, mock_bridge_v1):
async def setup_bridge(hass: HomeAssistant, mock_bridge_v1):
"""Load the Hue light platform with the provided bridge."""
hass.config.components.add(hue.DOMAIN)
config_entry = create_config_entry()
hass.config_entries.async_update_entry(
config_entry, options={CONF_ALLOW_HUE_GROUPS: True}
)
config_entry.add_to_hass(hass)
config_entry.mock_state(hass, ConfigEntryState.LOADED)
config_entry.options = {CONF_ALLOW_HUE_GROUPS: True}
mock_bridge_v1.config_entry = config_entry
hass.data[hue.DOMAIN] = {config_entry.entry_id: mock_bridge_v1}
await hass.config_entries.async_forward_entry_setup(config_entry, "light")