Add device info to generic camera (#103715)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Jan-Philipp Benecke 2023-11-14 10:50:55 +01:00 committed by GitHub
parent 0a84c2dba6
commit fe15ed4a28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,7 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import config_validation as cv, template as template_helper
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.httpx_client import get_async_client
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
@ -172,6 +173,11 @@ class GenericCamera(Camera):
self._last_url = None
self._last_image = None
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, identifier)},
manufacturer="Generic",
)
@property
def use_stream_for_stills(self) -> bool:
"""Whether or not to use stream to generate stills."""