Don't use len(SEQUENCE) as condition value (#7249)
* Don't use len(SEQUENCE) as condition value * Update volvooncall.py
This commit is contained in:
parent
15b2473224
commit
cfc023e128
43 changed files with 319 additions and 355 deletions
|
@ -42,7 +42,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the microsoft face identify platform."""
|
||||
"""Set up the Microsoft face identify platform."""
|
||||
api = hass.data[DATA_MICROSOFT_FACE]
|
||||
face_group = config[CONF_GROUP]
|
||||
confidence = config[CONF_CONFIDENCE]
|
||||
|
@ -197,7 +197,7 @@ class MicrosoftFaceIdentifyEntity(ImageProcessingFaceEntity):
|
|||
{'faceIds': face_ids, 'personGroupId': self._face_group})
|
||||
|
||||
except HomeAssistantError as err:
|
||||
_LOGGER.error("Can't process image on microsoft face: %s", err)
|
||||
_LOGGER.error("Can't process image on Microsoft face: %s", err)
|
||||
return
|
||||
|
||||
# parse data
|
||||
|
@ -205,7 +205,7 @@ class MicrosoftFaceIdentifyEntity(ImageProcessingFaceEntity):
|
|||
total = 0
|
||||
for face in detect:
|
||||
total += 1
|
||||
if len(face['candidates']) == 0:
|
||||
if not face['candidates']:
|
||||
continue
|
||||
|
||||
data = face['candidates'][0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue