mirror of
https://github.com/home-assistant/core.git
synced 2025-04-19 14:57:52 +00:00
Use typed config entry in mastodon (#132249)
This commit is contained in:
parent
5600ad0d82
commit
2ebc229d8d
@ -81,7 +81,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: MastodonConfigEntry) ->
|
||||
)
|
||||
|
||||
|
||||
async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
async def async_migrate_entry(hass: HomeAssistant, entry: MastodonConfigEntry) -> bool:
|
||||
"""Migrate old config."""
|
||||
|
||||
if entry.version == 1 and entry.minor_version == 1:
|
||||
@ -113,7 +113,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def setup_mastodon(entry: ConfigEntry) -> tuple[Mastodon, dict, dict]:
|
||||
def setup_mastodon(entry: MastodonConfigEntry) -> tuple[Mastodon, dict, dict]:
|
||||
"""Get mastodon details."""
|
||||
client = create_mastodon_client(
|
||||
entry.data[CONF_BASE_URL],
|
||||
|
@ -8,7 +8,7 @@ from mastodon.Mastodon import MastodonNetworkError, MastodonUnauthorizedError
|
||||
import voluptuous as vol
|
||||
from yarl import URL
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.const import (
|
||||
CONF_ACCESS_TOKEN,
|
||||
CONF_CLIENT_ID,
|
||||
@ -53,7 +53,6 @@ class MastodonConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
|
||||
VERSION = 1
|
||||
MINOR_VERSION = 2
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def check_connection(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user