diff --git a/homeassistant/components/onvif/config_flow.py b/homeassistant/components/onvif/config_flow.py index 5eef092a5cb..d9cf28f3e8b 100644 --- a/homeassistant/components/onvif/config_flow.py +++ b/homeassistant/components/onvif/config_flow.py @@ -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) diff --git a/homeassistant/components/onvif/device.py b/homeassistant/components/onvif/device.py index 3d74f1e4664..1556ae8a1fe 100644 --- a/homeassistant/components/onvif/device.py +++ b/homeassistant/components/onvif/device.py @@ -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,