mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Use ShellyConfigEntry type in Shelly config flow (#141103)
Use ShellyConfigEntry type in async_get_options_flow
This commit is contained in:
parent
ffd5c003cb
commit
c08cbf3763
@ -22,12 +22,7 @@ from aioshelly.exceptions import (
|
|||||||
from aioshelly.rpc_device import RpcDevice
|
from aioshelly.rpc_device import RpcDevice
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
|
||||||
ConfigEntry,
|
|
||||||
ConfigFlow,
|
|
||||||
ConfigFlowResult,
|
|
||||||
OptionsFlow,
|
|
||||||
)
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
CONF_MAC,
|
CONF_MAC,
|
||||||
@ -49,7 +44,7 @@ from .const import (
|
|||||||
LOGGER,
|
LOGGER,
|
||||||
BLEScannerMode,
|
BLEScannerMode,
|
||||||
)
|
)
|
||||||
from .coordinator import async_reconnect_soon
|
from .coordinator import ShellyConfigEntry, async_reconnect_soon
|
||||||
from .utils import (
|
from .utils import (
|
||||||
get_block_device_sleep_period,
|
get_block_device_sleep_period,
|
||||||
get_coap_context,
|
get_coap_context,
|
||||||
@ -458,13 +453,13 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
def async_get_options_flow(config_entry: ShellyConfigEntry) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler()
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@callback
|
@callback
|
||||||
def async_supports_options_flow(cls, config_entry: ConfigEntry) -> bool:
|
def async_supports_options_flow(cls, config_entry: ShellyConfigEntry) -> bool:
|
||||||
"""Return options flow support for this handler."""
|
"""Return options flow support for this handler."""
|
||||||
return (
|
return (
|
||||||
get_device_entry_gen(config_entry) in RPC_GENERATIONS
|
get_device_entry_gen(config_entry) in RPC_GENERATIONS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user