mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Fix Daikin duplicate entries (#35833)
This commit is contained in:
parent
1502701e2b
commit
2b3cf97979
@ -16,7 +16,7 @@ from homeassistant.helpers.typing import HomeAssistantType
|
|||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
from . import config_flow # noqa: F401
|
from . import config_flow # noqa: F401
|
||||||
from .const import CONF_KEY, CONF_UUID, TIMEOUT
|
from .const import CONF_KEY, CONF_UUID, KEY_MAC, TIMEOUT
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -61,6 +61,9 @@ async def async_setup(hass, config):
|
|||||||
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
||||||
"""Establish connection with Daikin."""
|
"""Establish connection with Daikin."""
|
||||||
conf = entry.data
|
conf = entry.data
|
||||||
|
# For backwards compat, set unique ID
|
||||||
|
if entry.unique_id is None:
|
||||||
|
hass.config_entries.async_update_entry(entry, unique_id=conf[KEY_MAC])
|
||||||
daikin_api = await daikin_api_setup(
|
daikin_api = await daikin_api_setup(
|
||||||
hass,
|
hass,
|
||||||
conf[CONF_HOST],
|
conf[CONF_HOST],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user