Add device_class to image_processing ()

* Add image_processing device_class

* Fix comments

* address comments
pull/5170/merge
Pascal Vizeli 2017-02-23 17:33:54 +01:00 committed by GitHub
parent b725eaf67f
commit 1cd1facbd0
3 changed files with 15 additions and 0 deletions
homeassistant/components/image_processing

View File

@ -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'

View File

@ -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."""

View File

@ -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."""