mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +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)
|
device.config_entry.data.get(CONF_SNAPSHOT_AUTH)
|
||||||
== HTTP_BASIC_AUTHENTICATION
|
== HTTP_BASIC_AUTHENTICATION
|
||||||
)
|
)
|
||||||
self._stream_uri = None
|
self._stream_uri: str | None = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
@ -185,7 +185,7 @@ class ONVIFCameraEntity(ONVIFBaseEntity, Camera):
|
|||||||
finally:
|
finally:
|
||||||
await stream.close()
|
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."""
|
"""Run when entity about to be added to hass."""
|
||||||
uri_no_auth = await self.device.async_get_stream_uri(self.profile)
|
uri_no_auth = await self.device.async_get_stream_uri(self.profile)
|
||||||
url = URL(uri_no_auth)
|
url = URL(uri_no_auth)
|
||||||
|
@ -74,12 +74,12 @@ class ONVIFDevice:
|
|||||||
return self.config_entry.data[CONF_PORT]
|
return self.config_entry.data[CONF_PORT]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def username(self) -> int:
|
def username(self) -> str:
|
||||||
"""Return the username of this device."""
|
"""Return the username of this device."""
|
||||||
return self.config_entry.data[CONF_USERNAME]
|
return self.config_entry.data[CONF_USERNAME]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def password(self) -> int:
|
def password(self) -> str:
|
||||||
"""Return the password of this device."""
|
"""Return the password of this device."""
|
||||||
return self.config_entry.data[CONF_PASSWORD]
|
return self.config_entry.data[CONF_PASSWORD]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user