mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +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(
|
face_data = yield from self._api.call_api(
|
||||||
'post', 'detect', image, binary=True)
|
'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(
|
detect = yield from self._api.call_api(
|
||||||
'post', 'identify',
|
'post', 'identify',
|
||||||
{'faceIds': face_ids, 'personGroupId': self._face_group})
|
{'faceIds': face_ids, 'personGroupId': self._face_group})
|
||||||
|
@ -367,7 +367,7 @@ class MicrosoftFace(object):
|
|||||||
|
|
||||||
answer = yield from response.json()
|
answer = yield from response.json()
|
||||||
_LOGGER.debug("Read from microsoft face api: %s", answer)
|
_LOGGER.debug("Read from microsoft face api: %s", answer)
|
||||||
if response.status == 200:
|
if response.status == 200 or response.status == 202:
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
_LOGGER.warning("Error %d microsoft face api %s",
|
_LOGGER.warning("Error %d microsoft face api %s",
|
||||||
|
@ -154,7 +154,7 @@ microsoft_face:
|
|||||||
description: Train a person group.
|
description: Train a person group.
|
||||||
|
|
||||||
fields:
|
fields:
|
||||||
name:
|
group:
|
||||||
description: Name of the group
|
description: Name of the group
|
||||||
example: 'family'
|
example: 'family'
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ microsoft_face:
|
|||||||
description: Add a new picture to a person.
|
description: Add a new picture to a person.
|
||||||
|
|
||||||
fields:
|
fields:
|
||||||
name:
|
person:
|
||||||
description: Name of the person
|
description: Name of the person
|
||||||
example: 'Hans'
|
example: 'Hans'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user