Enable strict typing for dlna_dms (#107305)

This commit is contained in:
Marc Mueller 2024-01-08 10:45:51 +01:00 committed by GitHub
parent d0e6ce193c
commit 3632d6be46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -138,6 +138,7 @@ homeassistant.components.dhcp.*
homeassistant.components.diagnostics.*
homeassistant.components.discovergy.*
homeassistant.components.dlna_dmr.*
homeassistant.components.dlna_dms.*
homeassistant.components.dnsip.*
homeassistant.components.doorbird.*
homeassistant.components.dormakaba_dkey.*

View File

@ -332,7 +332,7 @@ class DmsDeviceSource:
@property
def usn(self) -> str:
"""Get the USN (Unique Service Name) for the wrapped UPnP device end-point."""
return self.config_entry.data[CONF_DEVICE_ID]
return self.config_entry.data[CONF_DEVICE_ID] # type: ignore[no-any-return]
@property
def udn(self) -> str:
@ -347,7 +347,7 @@ class DmsDeviceSource:
@property
def source_id(self) -> str:
"""Return a unique ID (slug) for this source for people to use in URLs."""
return self.config_entry.data[CONF_SOURCE_ID]
return self.config_entry.data[CONF_SOURCE_ID] # type: ignore[no-any-return]
@property
def icon(self) -> str | None:

View File

@ -25,7 +25,7 @@ from .const import DOMAIN, LOGGER, PATH_OBJECT_ID_FLAG, ROOT_OBJECT_ID, SOURCE_S
from .dms import DidlPlayMedia, get_domain_data
async def async_get_media_source(hass: HomeAssistant):
async def async_get_media_source(hass: HomeAssistant) -> DmsMediaSource:
"""Set up DLNA DMS media source."""
LOGGER.debug("Setting up DLNA media sources")
return DmsMediaSource(hass)

View File

@ -1141,6 +1141,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.dlna_dms.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.dnsip.*]
check_untyped_defs = true
disallow_incomplete_defs = true