Upgrade pillow to 6.2.0 (#27581)
This commit is contained in:
parent
bb2a1cd439
commit
bbafeb5da2
8 changed files with 21 additions and 26 deletions
|
@ -1,15 +1,20 @@
|
|||
"""Support for the QR image processing."""
|
||||
from homeassistant.core import split_entity_id
|
||||
"""Support for the QR code image processing."""
|
||||
import io
|
||||
|
||||
from PIL import Image
|
||||
from pyzbar import pyzbar
|
||||
|
||||
from homeassistant.components.image_processing import (
|
||||
ImageProcessingEntity,
|
||||
CONF_SOURCE,
|
||||
CONF_ENTITY_ID,
|
||||
CONF_NAME,
|
||||
CONF_SOURCE,
|
||||
ImageProcessingEntity,
|
||||
)
|
||||
from homeassistant.core import split_entity_id
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the demo image processing platform."""
|
||||
"""Set up the QR code image processing platform."""
|
||||
# pylint: disable=unused-argument
|
||||
entities = []
|
||||
for camera in config[CONF_SOURCE]:
|
||||
|
@ -19,7 +24,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
|
||||
|
||||
class QrEntity(ImageProcessingEntity):
|
||||
"""QR image processing entity."""
|
||||
"""A QR image processing entity."""
|
||||
|
||||
def __init__(self, camera_entity, name):
|
||||
"""Initialize QR image processing entity."""
|
||||
|
@ -49,10 +54,6 @@ class QrEntity(ImageProcessingEntity):
|
|||
|
||||
def process_image(self, image):
|
||||
"""Process image."""
|
||||
import io
|
||||
from pyzbar import pyzbar
|
||||
from PIL import Image
|
||||
|
||||
stream = io.BytesIO(image)
|
||||
img = Image.open(stream)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue