mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Ring: Add partial back (#107040)
This commit is contained in:
parent
0183affc7c
commit
890615bb92
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -40,9 +41,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
def token_updater(token):
|
def token_updater(token):
|
||||||
"""Handle from sync context when token is updated."""
|
"""Handle from sync context when token is updated."""
|
||||||
hass.loop.call_soon_threadsafe(
|
hass.loop.call_soon_threadsafe(
|
||||||
hass.config_entries.async_update_entry,
|
partial(
|
||||||
entry,
|
hass.config_entries.async_update_entry,
|
||||||
data={**entry.data, CONF_TOKEN: token},
|
entry,
|
||||||
|
data={**entry.data, CONF_TOKEN: token},
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
auth = ring_doorbell.Auth(
|
auth = ring_doorbell.Auth(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user