Add image_processing device_class StrEnum (#79124)
This commit is contained in:
parent
4460953ff4
commit
50e732d00f
3 changed files with 23 additions and 20 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue