Skip to content

Commit 275c478

Browse files
committed
Reload now stores new TokenSet in config_entries
1 parent 938158a commit 275c478

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

custom_components/daikin_residential/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, SERVICE_RELOAD
99
from homeassistant.helpers.typing import HomeAssistantType
1010

11-
from .const import DOMAIN, DAIKIN_API, DAIKIN_DEVICES
11+
from .const import DOMAIN, DAIKIN_API, DAIKIN_DEVICES, CONF_TOKENSET
1212

1313
from .daikin_api import DaikinApi
1414

@@ -53,6 +53,10 @@ async def _handle_reload(service):
5353
daikin_api = hass.data[DOMAIN][DAIKIN_API]
5454
data = daikin_api._config_entry.data.copy()
5555
await daikin_api.retrieveAccessToken(data[CONF_EMAIL], data[CONF_PASSWORD])
56+
data[CONF_TOKENSET] = daikin_api.tokenSet
57+
hass.config_entries.async_update_entry(
58+
entry=daikin_api._config_entry, data=data
59+
)
5660
except Exception as e:
5761
_LOGGER.error("Failed to reload integration: %s", e)
5862

0 commit comments

Comments
 (0)