mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Improve type hint in onvif (#77833)
This commit is contained in:
parent
b4669d8939
commit
36f3028ec3
@ -109,7 +109,7 @@ class ONVIFCameraEntity(ONVIFBaseEntity, Camera):
|
||||
device.config_entry.data.get(CONF_SNAPSHOT_AUTH)
|
||||
== HTTP_BASIC_AUTHENTICATION
|
||||
)
|
||||
self._stream_uri = None
|
||||
self._stream_uri: str | None = None
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
@ -185,7 +185,7 @@ class ONVIFCameraEntity(ONVIFBaseEntity, Camera):
|
||||
finally:
|
||||
await stream.close()
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Run when entity about to be added to hass."""
|
||||
uri_no_auth = await self.device.async_get_stream_uri(self.profile)
|
||||
url = URL(uri_no_auth)
|
||||
|
@ -74,12 +74,12 @@ class ONVIFDevice:
|
||||
return self.config_entry.data[CONF_PORT]
|
||||
|
||||
@property
|
||||
def username(self) -> int:
|
||||
def username(self) -> str:
|
||||
"""Return the username of this device."""
|
||||
return self.config_entry.data[CONF_USERNAME]
|
||||
|
||||
@property
|
||||
def password(self) -> int:
|
||||
def password(self) -> str:
|
||||
"""Return the password of this device."""
|
||||
return self.config_entry.data[CONF_PASSWORD]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user