mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Improve type hints in onvif (#87184)
This commit is contained in:
parent
843e3ca9e6
commit
9327947332
@ -26,7 +26,7 @@ from homeassistant.const import (
|
||||
CONF_PORT,
|
||||
CONF_USERNAME,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
from .const import CONF_DEVICE_ID, DEFAULT_ARGUMENTS, DEFAULT_PORT, DOMAIN, LOGGER
|
||||
from .device import get_device
|
||||
@ -45,7 +45,7 @@ def wsdiscovery() -> list[Service]:
|
||||
return services
|
||||
|
||||
|
||||
async def async_discovery(hass) -> list[dict[str, Any]]:
|
||||
async def async_discovery(hass: HomeAssistant) -> list[dict[str, Any]]:
|
||||
"""Return if there are devices that can be discovered."""
|
||||
LOGGER.debug("Starting ONVIF discovery")
|
||||
services = await hass.async_add_executor_job(wsdiscovery)
|
||||
|
@ -561,7 +561,13 @@ class ONVIFDevice:
|
||||
LOGGER.error("Error trying to set Imaging settings: %s", err)
|
||||
|
||||
|
||||
def get_device(hass, host, port, username, password) -> ONVIFCamera:
|
||||
def get_device(
|
||||
hass: HomeAssistant,
|
||||
host: str,
|
||||
port: int,
|
||||
username: str | None,
|
||||
password: str | None,
|
||||
) -> ONVIFCamera:
|
||||
"""Get ONVIFCamera instance."""
|
||||
return ONVIFCamera(
|
||||
host,
|
||||
|
Loading…
x
Reference in New Issue
Block a user