Use runtime_data in Axis integration (#116729)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Robert Svensson 2024-05-03 21:52:37 +02:00 committed by GitHub
parent ce8cea86a2
commit 81a269f4f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 47 additions and 56 deletions

View file

@ -4,12 +4,12 @@ from urllib.parse import urlencode
from homeassistant.components.camera import CameraEntityFeature
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import HTTP_DIGEST_AUTHENTICATION
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AxisConfigEntry
from .const import DEFAULT_STREAM_PROFILE, DEFAULT_VIDEO_SOURCE
from .entity import AxisEntity
from .hub import AxisHub
@ -17,13 +17,13 @@ from .hub import AxisHub
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AxisConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Axis camera video stream."""
filter_urllib3_logging()
hub = AxisHub.get_hub(hass, config_entry)
hub = config_entry.runtime_data
if (
not (prop := hub.api.vapix.params.property_handler.get("0"))