Skip to content

Commit

Permalink
Fix cloud streams for HA 2024.4 (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
dext0r committed Apr 8, 2024
1 parent 886f314 commit 1308302
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/yandex_smart_home/cloud_stream.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implement the Yandex Smart Home cloud connection manager for video streaming."""

import asyncio
from datetime import timedelta
import logging
Expand Down Expand Up @@ -29,6 +30,11 @@
from pydantic import BaseModel
import yarl

try:
from homeassistant.helpers.http import KEY_HASS # type: ignore
except ImportError:
KEY_HASS = "hass" # type: ignore

from .const import CLOUD_STREAM_BASE_URL

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -58,7 +64,7 @@ class WebRequest:

def __init__(self, hass: HomeAssistant, url: yarl.URL):
"""Initialize web request from url."""
self.app = {"hass": hass}
self.app = {KEY_HASS: hass}
self._url = url

@property
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

[[tool.mypy.overrides]]
module = "custom_components.yandex_smart_home.cloud_stream"
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_calls = false
Expand Down

0 comments on commit 1308302

Please sign in to comment.