mirror of
https://github.com/home-assistant/core.git
synced 2025-12-19 18:38:58 +00:00
Fix return type annotations and enable strict typing in Xbox integration (#156746)
This commit is contained in:
@@ -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.*
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
10
mypy.ini
generated
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user