Add CameraEntityDescription to camera integration (#53636)

This commit is contained in:
jan iversen 2021-07-28 21:09:45 +02:00 committed by GitHub
parent c53e7bc8c2
commit 19245a5b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import base64
import collections import collections
from collections.abc import Awaitable, Mapping from collections.abc import Awaitable, Mapping
from contextlib import suppress from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime, timedelta from datetime import datetime, timedelta
import hashlib import hashlib
import logging import logging
@ -46,7 +47,7 @@ from homeassistant.helpers.config_validation import ( # noqa: F401
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE, PLATFORM_SCHEMA_BASE,
) )
from homeassistant.helpers.entity import Entity, entity_sources from homeassistant.helpers.entity import Entity, EntityDescription, entity_sources
from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.network import get_url from homeassistant.helpers.network import get_url
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
@ -117,6 +118,11 @@ SCHEMA_WS_CAMERA_THUMBNAIL: Final = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.ex
) )
@dataclass
class CameraEntityDescription(EntityDescription):
"""A class that describes camera entities."""
@attr.s @attr.s
class Image: class Image:
"""Represent an image.""" """Represent an image."""