Skip to content

Commit eb9d625

Browse files
authored
Fix return type annotations and enable strict typing in Xbox integration (home-assistant#156746)
1 parent 3a69534 commit eb9d625

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

.strict-typing

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ homeassistant.components.wiz.*
579579
homeassistant.components.wled.*
580580
homeassistant.components.workday.*
581581
homeassistant.components.worldclock.*
582+
homeassistant.components.xbox.*
582583
homeassistant.components.xiaomi_ble.*
583584
homeassistant.components.yale_smart_alarm.*
584585
homeassistant.components.yalexs_ble.*

homeassistant/components/xbox/browse_media.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def build_item_response(
130130
)
131131

132132

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

homeassistant/components/xbox/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def __init__(
335335
)
336336

337337
@property
338-
def data(self):
338+
def data(self) -> StorageDevice | None:
339339
"""Storage device data."""
340340
consoles = self.coordinator.data.result
341341
console = next((c for c in consoles if c.id == self._console.id), None)

mypy.ini

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)