from .const import CONF_DATA_COLLECTION_OPTED_IN as CONF_DATA_COLLECTION_OPTED_IN, DATA_CLIENT as DATA_CLIENT, DOMAIN as DOMAIN, EVENT_DEVICE_ADDED_TO_REGISTRY as EVENT_DEVICE_ADDED_TO_REGISTRY
from .helpers import async_enable_statistics as async_enable_statistics, update_data_collection_preference as update_data_collection_preference
from .services import BITMASK_SCHEMA as BITMASK_SCHEMA
from aiohttp import web
from homeassistant.components import websocket_api as websocket_api
from homeassistant.components.http.view import HomeAssistantView as HomeAssistantView
from homeassistant.components.websocket_api.connection import ActiveConnection as ActiveConnection
from homeassistant.components.websocket_api.const import ERR_NOT_FOUND as ERR_NOT_FOUND, ERR_NOT_SUPPORTED as ERR_NOT_SUPPORTED, ERR_UNKNOWN_ERROR as ERR_UNKNOWN_ERROR
from homeassistant.config_entries import ConfigEntry as ConfigEntry, ConfigEntryState as ConfigEntryState
from homeassistant.const import CONF_URL as CONF_URL
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
from homeassistant.exceptions import Unauthorized as Unauthorized
from homeassistant.helpers.aiohttp_client import async_get_clientsession as async_get_clientsession
from homeassistant.helpers.device_registry import DeviceEntry as DeviceEntry
from homeassistant.helpers.dispatcher import async_dispatcher_connect as async_dispatcher_connect
from typing import Callable
from zwave_js_server.client import Client as Client
from zwave_js_server.model.controller import ControllerStatistics as ControllerStatistics
from zwave_js_server.model.firmware import FirmwareUpdateFinished as FirmwareUpdateFinished, FirmwareUpdateProgress as FirmwareUpdateProgress
from zwave_js_server.model.log_message import LogMessage as LogMessage
from zwave_js_server.model.node import Node as Node, NodeStatistics as NodeStatistics

DATA_UNSUBSCRIBE: str
ID: str
ENTRY_ID: str
ERR_NOT_LOADED: str
NODE_ID: str
COMMAND_CLASS_ID: str
TYPE: str
PROPERTY: str
PROPERTY_KEY: str
VALUE: str
SECURE: str
CONFIG: str
LEVEL: str
LOG_TO_FILE: str
FILENAME: str
ENABLED: str
FORCE_CONSOLE: str
VALUE_ID: str
STATUS: str
OPTED_IN: str

def async_get_entry(orig_func: Callable) -> Callable: ...
def async_get_node(orig_func: Callable) -> Callable: ...
def async_handle_failed_command(orig_func: Callable) -> Callable: ...
def async_register_api(hass: HomeAssistant) -> None: ...
async def websocket_network_status(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_node_status(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_node_state(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_node_metadata(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_ping_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_add_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_stop_inclusion(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_stop_exclusion(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_remove_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_replace_failed_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_remove_failed_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_begin_healing_network(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_subscribe_heal_network_progress(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_stop_healing_network(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_heal_node(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_refresh_node_info(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_refresh_node_values(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_refresh_node_cc_values(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_set_config_parameter(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
async def websocket_get_config_parameters(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
def filename_is_present_if_logging_to_file(obj: dict) -> dict: ...
async def websocket_subscribe_log_updates(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_update_log_config(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_get_log_config(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_update_data_collection_preference(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_data_collection_status(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...

class DumpView(HomeAssistantView):
    url: str
    name: str
    async def get(self, request: web.Request, config_entry_id: str) -> web.Response: ...

async def websocket_version_info(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_abort_firmware_update(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
def _get_firmware_update_progress_dict(progress: FirmwareUpdateProgress) -> dict[str, int]: ...
async def websocket_subscribe_firmware_update_status(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...

class FirmwareUploadView(HomeAssistantView):
    url: str
    name: str
    async def post(self, request: web.Request, config_entry_id: str, node_id: str) -> web.Response: ...

async def websocket_check_for_config_updates(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
async def websocket_install_config_update(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
def _get_controller_statistics_dict(statistics: ControllerStatistics) -> dict[str, int]: ...
async def websocket_subscribe_controller_statistics(hass: HomeAssistant, connection: ActiveConnection, msg: dict, entry: ConfigEntry, client: Client) -> None: ...
def _get_node_statistics_dict(statistics: NodeStatistics) -> dict[str, int]: ...
async def websocket_subscribe_node_statistics(hass: HomeAssistant, connection: ActiveConnection, msg: dict, node: Node) -> None: ...
