mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use get_ffmpeg_manager instead of accessing hass.data directly in ring (#73374)
Use get_ffmpeg_manager intead of accessing hass.data directly in ring
This commit is contained in:
parent
297072c1f6
commit
51f88d3dad
@ -10,7 +10,6 @@ import requests
|
|||||||
|
|
||||||
from homeassistant.components import ffmpeg
|
from homeassistant.components import ffmpeg
|
||||||
from homeassistant.components.camera import Camera
|
from homeassistant.components.camera import Camera
|
||||||
from homeassistant.components.ffmpeg import DATA_FFMPEG
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION
|
from homeassistant.const import ATTR_ATTRIBUTION
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -33,6 +32,7 @@ async def async_setup_entry(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Set up a Ring Door Bell and StickUp Camera."""
|
"""Set up a Ring Door Bell and StickUp Camera."""
|
||||||
devices = hass.data[DOMAIN][config_entry.entry_id]["devices"]
|
devices = hass.data[DOMAIN][config_entry.entry_id]["devices"]
|
||||||
|
ffmpeg_manager = ffmpeg.get_ffmpeg_manager(hass)
|
||||||
|
|
||||||
cams = []
|
cams = []
|
||||||
for camera in chain(
|
for camera in chain(
|
||||||
@ -41,7 +41,7 @@ async def async_setup_entry(
|
|||||||
if not camera.has_subscription:
|
if not camera.has_subscription:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cams.append(RingCam(config_entry.entry_id, hass.data[DATA_FFMPEG], camera))
|
cams.append(RingCam(config_entry.entry_id, ffmpeg_manager, camera))
|
||||||
|
|
||||||
async_add_entities(cams)
|
async_add_entities(cams)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user