1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

Fix return type annotations and enable strict typing in Xbox integration (#156746)

This commit is contained in:
Manu
2025-11-17 14:38:02 +01:00
committed by GitHub
parent 3a69534b09
commit eb9d625926
4 changed files with 13 additions and 2 deletions

View File

@@ -579,6 +579,7 @@ homeassistant.components.wiz.*
homeassistant.components.wled.*
homeassistant.components.workday.*
homeassistant.components.worldclock.*
homeassistant.components.xbox.*
homeassistant.components.xiaomi_ble.*
homeassistant.components.yale_smart_alarm.*
homeassistant.components.yalexs_ble.*

View File

@@ -130,7 +130,7 @@ async def build_item_response(
)
def item_payload(item: InstalledPackage, images: dict[str, list[Image]]):
def item_payload(item: InstalledPackage, images: dict[str, list[Image]]) -> BrowseMedia:
"""Create response payload for a single media item."""
thumbnail = None
image = _find_media_image(images.get(item.one_store_product_id, [])) # type: ignore[arg-type]

View File

@@ -335,7 +335,7 @@ class XboxStorageDeviceSensorEntity(
)
@property
def data(self):
def data(self) -> StorageDevice | None:
"""Storage device data."""
consoles = self.coordinator.data.result
console = next((c for c in consoles if c.id == self._console.id), None)

10
mypy.ini generated
View File

@@ -5549,6 +5549,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.xbox.*]
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.xiaomi_ble.*]
check_untyped_defs = true
disallow_incomplete_defs = true