from .const import AIOSHELLY_DEVICE_TIMEOUT_SEC as AIOSHELLY_DEVICE_TIMEOUT_SEC, ATTR_BETA as ATTR_BETA, ATTR_CHANNEL as ATTR_CHANNEL, ATTR_CLICK_TYPE as ATTR_CLICK_TYPE, ATTR_DEVICE as ATTR_DEVICE, ATTR_GENERATION as ATTR_GENERATION, BATTERY_DEVICES_WITH_PERMANENT_CONNECTION as BATTERY_DEVICES_WITH_PERMANENT_CONNECTION, BLOCK as BLOCK, CONF_COAP_PORT as CONF_COAP_PORT, CONF_SLEEP_PERIOD as CONF_SLEEP_PERIOD, DATA_CONFIG_ENTRY as DATA_CONFIG_ENTRY, DEFAULT_COAP_PORT as DEFAULT_COAP_PORT, DEVICE as DEVICE, DOMAIN as DOMAIN, DUAL_MODE_LIGHT_MODELS as DUAL_MODE_LIGHT_MODELS, ENTRY_RELOAD_COOLDOWN as ENTRY_RELOAD_COOLDOWN, EVENT_SHELLY_CLICK as EVENT_SHELLY_CLICK, INPUTS_EVENTS_DICT as INPUTS_EVENTS_DICT, MODELS_SUPPORTING_LIGHT_EFFECTS as MODELS_SUPPORTING_LIGHT_EFFECTS, POLLING_TIMEOUT_SEC as POLLING_TIMEOUT_SEC, REST as REST, REST_SENSORS_UPDATE_INTERVAL as REST_SENSORS_UPDATE_INTERVAL, RPC as RPC, RPC_INPUTS_EVENTS_TYPES as RPC_INPUTS_EVENTS_TYPES, RPC_POLL as RPC_POLL, RPC_RECONNECT_INTERVAL as RPC_RECONNECT_INTERVAL, RPC_SENSORS_POLLING_INTERVAL as RPC_SENSORS_POLLING_INTERVAL, SHBTN_MODELS as SHBTN_MODELS, SLEEP_PERIOD_MULTIPLIER as SLEEP_PERIOD_MULTIPLIER, UPDATE_PERIOD_MULTIPLIER as UPDATE_PERIOD_MULTIPLIER
from .utils import device_update_info as device_update_info, get_block_device_name as get_block_device_name, get_block_device_sleep_period as get_block_device_sleep_period, get_coap_context as get_coap_context, get_device_entry_gen as get_device_entry_gen, get_rpc_device_name as get_rpc_device_name
from aioshelly.block_device import BlockDevice
from aioshelly.rpc_device import RpcDevice
from homeassistant.config_entries import ConfigEntry as ConfigEntry
from homeassistant.const import ATTR_DEVICE_ID as ATTR_DEVICE_ID, CONF_HOST as CONF_HOST, CONF_PASSWORD as CONF_PASSWORD, CONF_USERNAME as CONF_USERNAME, EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP, Platform as Platform
from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
from homeassistant.exceptions import ConfigEntryNotReady as ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client as aiohttp_client, device_registry as device_registry, update_coordinator as update_coordinator
from homeassistant.helpers.debounce import Debouncer as Debouncer
from homeassistant.helpers.typing import ConfigType as ConfigType
from typing import Any, Final

BLOCK_PLATFORMS: Final[Any]
BLOCK_SLEEPING_PLATFORMS: Final[Any]
RPC_PLATFORMS: Final[Any]
_LOGGER: Final[Any]
COAP_SCHEMA: Final[Any]
CONFIG_SCHEMA: Final[Any]

async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ...
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ...
async def async_setup_block_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ...
async def async_block_device_setup(hass: HomeAssistant, entry: ConfigEntry, device: BlockDevice) -> None: ...
async def async_setup_rpc_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ...

class BlockDeviceWrapper(update_coordinator.DataUpdateCoordinator):
    device_id: Any
    hass: Any
    entry: Any
    device: Any
    _debounced_reload: Any
    _last_cfg_changed: Any
    _last_mode: Any
    _last_effect: Any
    _last_input_events_count: Any
    def __init__(self, hass: HomeAssistant, entry: ConfigEntry, device: BlockDevice) -> None: ...
    async def _async_reload_entry(self) -> None: ...
    def _async_device_updates_handler(self) -> None: ...
    async def _async_update_data(self) -> None: ...
    @property
    def model(self) -> str: ...
    @property
    def mac(self) -> str: ...
    @property
    def sw_version(self) -> str: ...
    def async_setup(self) -> None: ...
    async def async_trigger_ota_update(self, beta: bool = ...) -> None: ...
    def shutdown(self) -> None: ...
    def _handle_ha_stop(self, _event: Event) -> None: ...

class ShellyDeviceRestWrapper(update_coordinator.DataUpdateCoordinator):
    device: Any
    entry: Any
    def __init__(self, hass: HomeAssistant, device: BlockDevice, entry: ConfigEntry) -> None: ...
    async def _async_update_data(self) -> None: ...
    @property
    def mac(self) -> str: ...

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ...
def get_block_device_wrapper(hass: HomeAssistant, device_id: str) -> Union[BlockDeviceWrapper, None]: ...
def get_rpc_device_wrapper(hass: HomeAssistant, device_id: str) -> Union[RpcDeviceWrapper, None]: ...

class RpcDeviceWrapper(update_coordinator.DataUpdateCoordinator):
    device_id: Any
    entry: Any
    device: Any
    _debounced_reload: Any
    _last_event: Any
    def __init__(self, hass: HomeAssistant, entry: ConfigEntry, device: RpcDevice) -> None: ...
    async def _async_reload_entry(self) -> None: ...
    def _async_device_updates_handler(self) -> None: ...
    async def _async_update_data(self) -> None: ...
    @property
    def model(self) -> str: ...
    @property
    def mac(self) -> str: ...
    @property
    def sw_version(self) -> str: ...
    def async_setup(self) -> None: ...
    async def async_trigger_ota_update(self, beta: bool = ...) -> None: ...
    async def shutdown(self) -> None: ...
    async def _handle_ha_stop(self, _event: Event) -> None: ...

class RpcPollingWrapper(update_coordinator.DataUpdateCoordinator):
    device_id: Any
    entry: Any
    device: Any
    def __init__(self, hass: HomeAssistant, entry: ConfigEntry, device: RpcDevice) -> None: ...
    async def _async_update_data(self) -> None: ...
    @property
    def model(self) -> str: ...
    @property
    def mac(self) -> str: ...
