Improve type hint in onvif (#77833)

This commit is contained in:
epenet
2022-09-06 10:12:16 +02:00
committed by GitHub
parent b4669d8939
commit 36f3028ec3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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]