Skip to content

Commit

Permalink
Add device_class to image_processing (home-assistant#6186)
Browse files Browse the repository at this point in the history
* Add image_processing device_class

* Fix comments

* address comments
  • Loading branch information
pvizeli authored Feb 23, 2017
1 parent b725eaf commit 1cd1fac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homeassistant/components/image_processing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

SCAN_INTERVAL = timedelta(seconds=10)

DEVICE_CLASSES = [
'alpr', # automatic license plate recognition
'face', # face
]

SERVICE_SCAN = 'scan'

ATTR_CONFIDENCE = 'confidence'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def state(self):

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."""
Expand Down
5 changes: 5 additions & 0 deletions homeassistant/components/image_processing/openalpr_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ def state(self):
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."""
Expand Down

0 comments on commit 1cd1fac

Please sign in to comment.