import aioshelly
from .const import AIOSHELLY_DEVICE_TIMEOUT_SEC as AIOSHELLY_DEVICE_TIMEOUT_SEC, ATTR_CHANNEL as ATTR_CHANNEL, ATTR_CLICK_TYPE as ATTR_CLICK_TYPE, ATTR_DEVICE as ATTR_DEVICE, BATTERY_DEVICES_WITH_PERMANENT_CONNECTION as BATTERY_DEVICES_WITH_PERMANENT_CONNECTION, COAP as COAP, CONF_COAP_PORT as CONF_COAP_PORT, DATA_CONFIG_ENTRY as DATA_CONFIG_ENTRY, DEFAULT_COAP_PORT as DEFAULT_COAP_PORT, DEVICE as DEVICE, DOMAIN as DOMAIN, EVENT_SHELLY_CLICK as EVENT_SHELLY_CLICK, INPUTS_EVENTS_DICT as INPUTS_EVENTS_DICT, POLLING_TIMEOUT_SEC as POLLING_TIMEOUT_SEC, REST as REST, REST_SENSORS_UPDATE_INTERVAL as REST_SENSORS_UPDATE_INTERVAL, SHBTN_MODELS as SHBTN_MODELS, SLEEP_PERIOD_MULTIPLIER as SLEEP_PERIOD_MULTIPLIER, UPDATE_PERIOD_MULTIPLIER as UPDATE_PERIOD_MULTIPLIER
from .utils import get_coap_context as get_coap_context, get_device_name as get_device_name, get_device_sleep_period as get_device_sleep_period
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
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.typing import ConfigType as ConfigType
from typing import Any, Final

PLATFORMS: Final[Any]
SLEEPING_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_device_setup(hass: HomeAssistant, entry: ConfigEntry, device: aioshelly.Device) -> None: ...

class ShellyDeviceWrapper(update_coordinator.DataUpdateCoordinator):
    device_id: Any
    hass: Any
    entry: Any
    device: Any
    _async_remove_device_updates_handler: Any
    _last_input_events_count: Any
    def __init__(self, hass: HomeAssistant, entry: ConfigEntry, device: aioshelly.Device) -> 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: ...
    async def async_setup(self) -> None: ...
    def shutdown(self) -> None: ...
    def _handle_ha_stop(self, _event: Event) -> None: ...

class ShellyDeviceRestWrapper(update_coordinator.DataUpdateCoordinator):
    device: Any
    def __init__(self, hass: HomeAssistant, device: aioshelly.Device) -> 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_device_wrapper(hass: HomeAssistant, device_id: str) -> Union[ShellyDeviceWrapper, None]: ...
