mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
[microsoft_face] Small error fixes (#5577)
* [microsoft_face] Small error fixes * add array to exclusion
This commit is contained in:
parent
eadf67bd9a
commit
636e7aa31e
@ -160,8 +160,10 @@ class MicrosoftFaceIdentifyEntity(ImageProcessingFaceIdentifyEntity):
|
||||
face_data = yield from self._api.call_api(
|
||||
'post', 'detect', image, binary=True)
|
||||
|
||||
face_ids = [data['faceId'] for data in face_data]
|
||||
if face_data is None or len(face_data) < 1:
|
||||
return
|
||||
|
||||
face_ids = [data['faceId'] for data in face_data]
|
||||
detect = yield from self._api.call_api(
|
||||
'post', 'identify',
|
||||
{'faceIds': face_ids, 'personGroupId': self._face_group})
|
||||
|
@ -367,7 +367,7 @@ class MicrosoftFace(object):
|
||||
|
||||
answer = yield from response.json()
|
||||
_LOGGER.debug("Read from microsoft face api: %s", answer)
|
||||
if response.status == 200:
|
||||
if response.status == 200 or response.status == 202:
|
||||
return answer
|
||||
|
||||
_LOGGER.warning("Error %d microsoft face api %s",
|
||||
|
@ -154,7 +154,7 @@ microsoft_face:
|
||||
description: Train a person group.
|
||||
|
||||
fields:
|
||||
name:
|
||||
group:
|
||||
description: Name of the group
|
||||
example: 'family'
|
||||
|
||||
@ -186,7 +186,7 @@ microsoft_face:
|
||||
description: Add a new picture to a person.
|
||||
|
||||
fields:
|
||||
name:
|
||||
person:
|
||||
description: Name of the person
|
||||
example: 'Hans'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user