Add image_processing device_class StrEnum (#79124)

This commit is contained in:
Marc Mueller 2022-09-27 02:37:04 +02:00 committed by GitHub
parent 4460953ff4
commit 50e732d00f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 20 deletions

View file

@ -11,6 +11,7 @@ import voluptuous as vol
from homeassistant.components.image_processing import (
PLATFORM_SCHEMA,
ImageProcessingDeviceClass,
ImageProcessingEntity,
)
from homeassistant.const import CONF_ENTITY_ID, CONF_NAME, CONF_SOURCE
@ -69,6 +70,8 @@ async def async_setup_platform(
class ImageProcessingSsocr(ImageProcessingEntity):
"""Representation of the seven segments OCR image processing entity."""
_attr_device_class = ImageProcessingDeviceClass.OCR
def __init__(self, hass, camera_entity, config, name):
"""Initialize seven segments processing."""
self.hass = hass
@ -105,11 +108,6 @@ class ImageProcessingSsocr(ImageProcessingEntity):
)
self._command.append(self.filepath)
@property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return "ocr"
@property
def camera_entity(self):
"""Return camera entity id from process pictures."""