mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add ability to forget hive device when removing integration (#74144)
This commit is contained in:
parent
269fa14721
commit
4f842014ee
@ -7,7 +7,7 @@ import logging
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from aiohttp.web_exceptions import HTTPException
|
||||
from apyhiveapi import Hive
|
||||
from apyhiveapi import Auth, Hive
|
||||
from apyhiveapi.helper.hive_exceptions import HiveReauthRequired
|
||||
from typing_extensions import Concatenate, ParamSpec
|
||||
import voluptuous as vol
|
||||
@ -112,6 +112,15 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
return unload_ok
|
||||
|
||||
|
||||
async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Remove a config entry."""
|
||||
hive = Auth(entry.data["username"], entry.data["password"])
|
||||
await hive.forget_device(
|
||||
entry.data["tokens"]["AuthenticationResult"]["AccessToken"],
|
||||
entry.data["device_data"][1],
|
||||
)
|
||||
|
||||
|
||||
def refresh_system(
|
||||
func: Callable[Concatenate[_HiveEntityT, _P], Awaitable[Any]]
|
||||
) -> Callable[Concatenate[_HiveEntityT, _P], Coroutine[Any, Any, None]]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user