diff --git a/homeassistant/components/image_processing/manifest.json b/homeassistant/components/image_processing/manifest.json index 4a96e9828cb..6a88a358f1d 100644 --- a/homeassistant/components/image_processing/manifest.json +++ b/homeassistant/components/image_processing/manifest.json @@ -3,7 +3,7 @@ "name": "Image processing", "documentation": "https://www.home-assistant.io/integrations/image_processing", "requirements": [ - "pillow==6.1.0" + "pillow==6.2.0" ], "dependencies": [ "camera" diff --git a/homeassistant/components/proxy/camera.py b/homeassistant/components/proxy/camera.py index b1ce8ad7ac0..90487120ffe 100644 --- a/homeassistant/components/proxy/camera.py +++ b/homeassistant/components/proxy/camera.py @@ -1,12 +1,14 @@ """Proxy camera platform that enables image processing of camera data.""" import asyncio +from datetime import timedelta +import io import logging -from datetime import timedelta +from PIL import Image import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, Camera -from homeassistant.const import CONF_ENTITY_ID, CONF_NAME, CONF_MODE +from homeassistant.const import CONF_ENTITY_ID, CONF_MODE, CONF_NAME from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import config_validation as cv import homeassistant.util.dt as dt_util @@ -58,9 +60,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= def _precheck_image(image, opts): """Perform some pre-checks on the given image.""" - from PIL import Image - import io - if not opts: raise ValueError() try: @@ -77,9 +76,6 @@ def _precheck_image(image, opts): def _resize_image(image, opts): """Resize image.""" - from PIL import Image - import io - try: img = _precheck_image(image, opts) except ValueError: @@ -125,8 +121,6 @@ def _resize_image(image, opts): def _crop_image(image, opts): """Crop image.""" - import io - try: img = _precheck_image(image, opts) except ValueError: diff --git a/homeassistant/components/proxy/manifest.json b/homeassistant/components/proxy/manifest.json index c67fd4afc09..e3f62514801 100644 --- a/homeassistant/components/proxy/manifest.json +++ b/homeassistant/components/proxy/manifest.json @@ -3,7 +3,7 @@ "name": "Proxy", "documentation": "https://www.home-assistant.io/integrations/proxy", "requirements": [ - "pillow==6.1.0" + "pillow==6.2.0" ], "dependencies": [], "codeowners": [] diff --git a/homeassistant/components/qrcode/__init__.py b/homeassistant/components/qrcode/__init__.py index bcc1985a2dc..55b1a2a9d6b 100644 --- a/homeassistant/components/qrcode/__init__.py +++ b/homeassistant/components/qrcode/__init__.py @@ -1 +1 @@ -"""The qrcode component.""" +"""The QR code component.""" diff --git a/homeassistant/components/qrcode/image_processing.py b/homeassistant/components/qrcode/image_processing.py index 5e1b7c11b25..018f074a6d2 100644 --- a/homeassistant/components/qrcode/image_processing.py +++ b/homeassistant/components/qrcode/image_processing.py @@ -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) diff --git a/homeassistant/components/qrcode/manifest.json b/homeassistant/components/qrcode/manifest.json index 87e16f62987..a3130070cc3 100644 --- a/homeassistant/components/qrcode/manifest.json +++ b/homeassistant/components/qrcode/manifest.json @@ -3,7 +3,7 @@ "name": "Qrcode", "documentation": "https://www.home-assistant.io/integrations/qrcode", "requirements": [ - "pillow==6.1.0", + "pillow==6.2.0", "pyzbar==0.1.7" ], "dependencies": [], diff --git a/requirements_all.txt b/requirements_all.txt index b5ad094401f..a4623fe8bfb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -953,7 +953,7 @@ pilight==0.1.1 # homeassistant.components.image_processing # homeassistant.components.proxy # homeassistant.components.qrcode -pillow==6.1.0 +pillow==6.2.0 # homeassistant.components.dominos pizzapi==0.0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 143f219fecf..5c9f80e408c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -328,7 +328,7 @@ pilight==0.1.1 # homeassistant.components.image_processing # homeassistant.components.proxy # homeassistant.components.qrcode -pillow==6.1.0 +pillow==6.2.0 # homeassistant.components.plex plexapi==3.0.6