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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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]