2018-09-26 09:49:55 +02:00
|
|
|
"""Collection of helper methods.
|
|
|
|
|
|
|
|
All containing methods are legacy helpers that should not be used by new
|
|
|
|
components. Instead call the service directly.
|
|
|
|
"""
|
2020-04-11 21:10:15 +02:00
|
|
|
from homeassistant.components.camera.const import DATA_CAMERA_PREFS, PREF_PRELOAD_STREAM
|
2018-09-26 09:49:55 +02:00
|
|
|
|
|
|
|
|
2020-04-11 21:10:15 +02:00
|
|
|
def mock_camera_prefs(hass, entity_id, prefs=None):
|
2019-03-26 08:31:29 -04:00
|
|
|
"""Fixture for cloud component."""
|
2019-07-31 12:25:30 -07:00
|
|
|
prefs_to_set = {PREF_PRELOAD_STREAM: True}
|
2020-04-11 21:10:15 +02:00
|
|
|
if prefs is not None:
|
|
|
|
prefs_to_set.update(prefs)
|
2019-03-26 08:31:29 -04:00
|
|
|
hass.data[DATA_CAMERA_PREFS]._prefs[entity_id] = prefs_to_set
|
|
|
|
return prefs_to_set
|