mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add device_class to image_processing (#6186)
* Add image_processing device_class * Fix comments * address comments
This commit is contained in:
parent
b725eaf67f
commit
1cd1facbd0
@ -28,6 +28,11 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
SCAN_INTERVAL = timedelta(seconds=10)
|
SCAN_INTERVAL = timedelta(seconds=10)
|
||||||
|
|
||||||
|
DEVICE_CLASSES = [
|
||||||
|
'alpr', # automatic license plate recognition
|
||||||
|
'face', # face
|
||||||
|
]
|
||||||
|
|
||||||
SERVICE_SCAN = 'scan'
|
SERVICE_SCAN = 'scan'
|
||||||
|
|
||||||
ATTR_CONFIDENCE = 'confidence'
|
ATTR_CONFIDENCE = 'confidence'
|
||||||
|
@ -90,6 +90,11 @@ class ImageProcessingFaceEntity(ImageProcessingEntity):
|
|||||||
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
|
@property
|
||||||
|
def device_class(self):
|
||||||
|
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||||
|
return 'face'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
|
@ -94,6 +94,11 @@ class ImageProcessingAlprEntity(ImageProcessingEntity):
|
|||||||
plate = i_pl
|
plate = i_pl
|
||||||
return plate
|
return plate
|
||||||
|
|
||||||
|
@property
|
||||||
|
def device_class(self):
|
||||||
|
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||||
|
return 'alpr'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user