Add device_class to image_processing (#6186)
* Add image_processing device_class * Fix comments * address commentspull/5170/merge
parent
b725eaf67f
commit
1cd1facbd0
homeassistant/components/image_processing
|
@ -28,6 +28,11 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
SCAN_INTERVAL = timedelta(seconds=10)
|
||||
|
||||
DEVICE_CLASSES = [
|
||||
'alpr', # automatic license plate recognition
|
||||
'face', # face
|
||||
]
|
||||
|
||||
SERVICE_SCAN = 'scan'
|
||||
|
||||
ATTR_CONFIDENCE = 'confidence'
|
||||
|
|
|
@ -90,6 +90,11 @@ class ImageProcessingFaceEntity(ImageProcessingEntity):
|
|||
|
||||
return state
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return 'face'
|
||||
|
||||
@property
|
||||
def state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
|
|
|
@ -94,6 +94,11 @@ class ImageProcessingAlprEntity(ImageProcessingEntity):
|
|||
plate = i_pl
|
||||
return plate
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return 'alpr'
|
||||
|
||||
@property
|
||||
def state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
|
|
Loading…
Reference in New Issue