From 5c2c6026864b05750e0a320c6797060e97a2694f Mon Sep 17 00:00:00 2001 From: Christopher Bailey Date: Thu, 19 May 2022 21:34:58 -0400 Subject: [PATCH] Bumps pyunifiprotect to 3.6.0 (#72188) --- homeassistant/components/unifiprotect/button.py | 2 +- homeassistant/components/unifiprotect/camera.py | 3 +-- homeassistant/components/unifiprotect/config_flow.py | 2 +- homeassistant/components/unifiprotect/const.py | 2 +- homeassistant/components/unifiprotect/data.py | 3 ++- homeassistant/components/unifiprotect/entity.py | 2 +- homeassistant/components/unifiprotect/lock.py | 3 +-- homeassistant/components/unifiprotect/manifest.json | 2 +- homeassistant/components/unifiprotect/number.py | 2 +- homeassistant/components/unifiprotect/select.py | 3 ++- homeassistant/components/unifiprotect/switch.py | 8 ++++++-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/unifiprotect/conftest.py | 2 +- tests/components/unifiprotect/test_camera.py | 4 +--- tests/components/unifiprotect/test_config_flow.py | 2 +- tests/components/unifiprotect/test_lock.py | 3 +-- tests/components/unifiprotect/test_select.py | 11 +++++++---- tests/components/unifiprotect/test_sensor.py | 10 ++++++++-- tests/components/unifiprotect/test_switch.py | 9 +++++++-- 20 files changed, 46 insertions(+), 31 deletions(-) diff --git a/homeassistant/components/unifiprotect/button.py b/homeassistant/components/unifiprotect/button.py index 731b1eaf86a..fe82c0afbe0 100644 --- a/homeassistant/components/unifiprotect/button.py +++ b/homeassistant/components/unifiprotect/button.py @@ -4,7 +4,7 @@ from __future__ import annotations from dataclasses import dataclass from typing import Final -from pyunifiprotect.data.base import ProtectAdoptableDeviceModel +from pyunifiprotect.data import ProtectAdoptableDeviceModel from homeassistant.components.button import ( ButtonDeviceClass, diff --git a/homeassistant/components/unifiprotect/camera.py b/homeassistant/components/unifiprotect/camera.py index 928d82f317b..ca076e490a2 100644 --- a/homeassistant/components/unifiprotect/camera.py +++ b/homeassistant/components/unifiprotect/camera.py @@ -5,8 +5,7 @@ from collections.abc import Generator import logging from pyunifiprotect.api import ProtectApiClient -from pyunifiprotect.data import Camera as UFPCamera, StateType -from pyunifiprotect.data.devices import CameraChannel +from pyunifiprotect.data import Camera as UFPCamera, CameraChannel, StateType from homeassistant.components.camera import Camera, CameraEntityFeature from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/unifiprotect/config_flow.py b/homeassistant/components/unifiprotect/config_flow.py index 27108d24eaa..daaae214df9 100644 --- a/homeassistant/components/unifiprotect/config_flow.py +++ b/homeassistant/components/unifiprotect/config_flow.py @@ -6,7 +6,7 @@ from typing import Any from aiohttp import CookieJar from pyunifiprotect import NotAuthorized, NvrError, ProtectApiClient -from pyunifiprotect.data.nvr import NVR +from pyunifiprotect.data import NVR import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/unifiprotect/const.py b/homeassistant/components/unifiprotect/const.py index 7d2842977b6..0fe4ca98afa 100644 --- a/homeassistant/components/unifiprotect/const.py +++ b/homeassistant/components/unifiprotect/const.py @@ -1,6 +1,6 @@ """Constant definitions for UniFi Protect Integration.""" -from pyunifiprotect.data.types import ModelType, Version +from pyunifiprotect.data import ModelType, Version from homeassistant.const import Platform diff --git a/homeassistant/components/unifiprotect/data.py b/homeassistant/components/unifiprotect/data.py index 371c1c7831b..e20f956acd2 100644 --- a/homeassistant/components/unifiprotect/data.py +++ b/homeassistant/components/unifiprotect/data.py @@ -12,9 +12,10 @@ from pyunifiprotect.data import ( Event, Liveview, ModelType, + ProtectAdoptableDeviceModel, + ProtectDeviceModel, WSSubscriptionMessage, ) -from pyunifiprotect.data.base import ProtectAdoptableDeviceModel, ProtectDeviceModel from homeassistant.config_entries import ConfigEntry from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback diff --git a/homeassistant/components/unifiprotect/entity.py b/homeassistant/components/unifiprotect/entity.py index 045a9c4fd6d..45e52db5963 100644 --- a/homeassistant/components/unifiprotect/entity.py +++ b/homeassistant/components/unifiprotect/entity.py @@ -6,6 +6,7 @@ import logging from typing import Any from pyunifiprotect.data import ( + NVR, Camera, Doorlock, Event, @@ -16,7 +17,6 @@ from pyunifiprotect.data import ( StateType, Viewer, ) -from pyunifiprotect.data.nvr import NVR from homeassistant.core import callback import homeassistant.helpers.device_registry as dr diff --git a/homeassistant/components/unifiprotect/lock.py b/homeassistant/components/unifiprotect/lock.py index 6fb70a2523f..c4d56dd1e71 100644 --- a/homeassistant/components/unifiprotect/lock.py +++ b/homeassistant/components/unifiprotect/lock.py @@ -4,8 +4,7 @@ from __future__ import annotations import logging from typing import Any -from pyunifiprotect.data import Doorlock -from pyunifiprotect.data.types import LockStatusType +from pyunifiprotect.data import Doorlock, LockStatusType from homeassistant.components.lock import LockEntity, LockEntityDescription from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/unifiprotect/manifest.json b/homeassistant/components/unifiprotect/manifest.json index 36b6011e8fc..898abd73a6f 100644 --- a/homeassistant/components/unifiprotect/manifest.json +++ b/homeassistant/components/unifiprotect/manifest.json @@ -3,7 +3,7 @@ "name": "UniFi Protect", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/unifiprotect", - "requirements": ["pyunifiprotect==3.5.1", "unifi-discovery==1.1.3"], + "requirements": ["pyunifiprotect==3.6.0", "unifi-discovery==1.1.3"], "dependencies": ["http"], "codeowners": ["@briis", "@AngellusMortis", "@bdraco"], "quality_scale": "platinum", diff --git a/homeassistant/components/unifiprotect/number.py b/homeassistant/components/unifiprotect/number.py index d6dfba0c38f..58ae0502caa 100644 --- a/homeassistant/components/unifiprotect/number.py +++ b/homeassistant/components/unifiprotect/number.py @@ -4,7 +4,7 @@ from __future__ import annotations from dataclasses import dataclass from datetime import timedelta -from pyunifiprotect.data.devices import Camera, Doorlock, Light +from pyunifiprotect.data import Camera, Doorlock, Light from homeassistant.components.number import NumberEntity, NumberEntityDescription from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/unifiprotect/select.py b/homeassistant/components/unifiprotect/select.py index f0500ea54e5..2c6c5fa4cc6 100644 --- a/homeassistant/components/unifiprotect/select.py +++ b/homeassistant/components/unifiprotect/select.py @@ -11,17 +11,18 @@ from typing import Any, Final from pyunifiprotect.api import ProtectApiClient from pyunifiprotect.data import ( Camera, + ChimeType, DoorbellMessageType, Doorlock, IRLEDMode, Light, LightModeEnableType, LightModeType, + MountType, RecordingMode, Sensor, Viewer, ) -from pyunifiprotect.data.types import ChimeType, MountType import voluptuous as vol from homeassistant.components.select import SelectEntity, SelectEntityDescription diff --git a/homeassistant/components/unifiprotect/switch.py b/homeassistant/components/unifiprotect/switch.py index 6051e4e596f..971c637a8c2 100644 --- a/homeassistant/components/unifiprotect/switch.py +++ b/homeassistant/components/unifiprotect/switch.py @@ -5,8 +5,12 @@ from dataclasses import dataclass import logging from typing import Any -from pyunifiprotect.data import Camera, RecordingMode, VideoMode -from pyunifiprotect.data.base import ProtectAdoptableDeviceModel +from pyunifiprotect.data import ( + Camera, + ProtectAdoptableDeviceModel, + RecordingMode, + VideoMode, +) from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription from homeassistant.config_entries import ConfigEntry diff --git a/requirements_all.txt b/requirements_all.txt index 55765f9d139..4ac46752539 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1984,7 +1984,7 @@ pytrafikverket==0.2.0.1 pyudev==0.22.0 # homeassistant.components.unifiprotect -pyunifiprotect==3.5.1 +pyunifiprotect==3.6.0 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index fdbe51fbb49..0327dcfa142 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1313,7 +1313,7 @@ pytrafikverket==0.2.0.1 pyudev==0.22.0 # homeassistant.components.unifiprotect -pyunifiprotect==3.5.1 +pyunifiprotect==3.6.0 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0 diff --git a/tests/components/unifiprotect/conftest.py b/tests/components/unifiprotect/conftest.py index f495b2bc8f7..c83c6eb72cc 100644 --- a/tests/components/unifiprotect/conftest.py +++ b/tests/components/unifiprotect/conftest.py @@ -17,11 +17,11 @@ from pyunifiprotect.data import ( Doorlock, Light, Liveview, + ProtectAdoptableDeviceModel, Sensor, Viewer, WSSubscriptionMessage, ) -from pyunifiprotect.data.base import ProtectAdoptableDeviceModel from homeassistant.components.unifiprotect.const import DOMAIN from homeassistant.const import Platform diff --git a/tests/components/unifiprotect/test_camera.py b/tests/components/unifiprotect/test_camera.py index 362481bfb03..d7fc2a62325 100644 --- a/tests/components/unifiprotect/test_camera.py +++ b/tests/components/unifiprotect/test_camera.py @@ -6,9 +6,7 @@ from copy import copy from unittest.mock import AsyncMock, Mock import pytest -from pyunifiprotect.data import Camera as ProtectCamera -from pyunifiprotect.data.devices import CameraChannel -from pyunifiprotect.data.types import StateType +from pyunifiprotect.data import Camera as ProtectCamera, CameraChannel, StateType from pyunifiprotect.exceptions import NvrError from homeassistant.components.camera import ( diff --git a/tests/components/unifiprotect/test_config_flow.py b/tests/components/unifiprotect/test_config_flow.py index 59304ce915f..80e845591b1 100644 --- a/tests/components/unifiprotect/test_config_flow.py +++ b/tests/components/unifiprotect/test_config_flow.py @@ -7,7 +7,7 @@ from unittest.mock import patch import pytest from pyunifiprotect import NotAuthorized, NvrError -from pyunifiprotect.data.nvr import NVR +from pyunifiprotect.data import NVR from homeassistant import config_entries from homeassistant.components import dhcp, ssdp diff --git a/tests/components/unifiprotect/test_lock.py b/tests/components/unifiprotect/test_lock.py index 740cb61b3c4..0a02fcb22a4 100644 --- a/tests/components/unifiprotect/test_lock.py +++ b/tests/components/unifiprotect/test_lock.py @@ -6,8 +6,7 @@ from copy import copy from unittest.mock import AsyncMock, Mock import pytest -from pyunifiprotect.data import Doorlock -from pyunifiprotect.data.types import LockStatusType +from pyunifiprotect.data import Doorlock, LockStatusType from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION from homeassistant.const import ( diff --git a/tests/components/unifiprotect/test_select.py b/tests/components/unifiprotect/test_select.py index d09fa421ec3..fc0abbe29ca 100644 --- a/tests/components/unifiprotect/test_select.py +++ b/tests/components/unifiprotect/test_select.py @@ -7,16 +7,19 @@ from datetime import timedelta from unittest.mock import AsyncMock, Mock, patch import pytest -from pyunifiprotect.data import Camera, Light -from pyunifiprotect.data.devices import LCDMessage, Viewer -from pyunifiprotect.data.nvr import DoorbellMessage, Liveview -from pyunifiprotect.data.types import ( +from pyunifiprotect.data import ( + Camera, DoorbellMessageType, IRLEDMode, + LCDMessage, + Light, LightModeEnableType, LightModeType, + Liveview, RecordingMode, + Viewer, ) +from pyunifiprotect.data.nvr import DoorbellMessage from homeassistant.components.select.const import ATTR_OPTIONS from homeassistant.components.unifiprotect.const import ( diff --git a/tests/components/unifiprotect/test_sensor.py b/tests/components/unifiprotect/test_sensor.py index 971ee47405b..dff746c167f 100644 --- a/tests/components/unifiprotect/test_sensor.py +++ b/tests/components/unifiprotect/test_sensor.py @@ -7,10 +7,16 @@ from datetime import datetime, timedelta from unittest.mock import AsyncMock, Mock import pytest -from pyunifiprotect.data import NVR, Camera, Event, Sensor +from pyunifiprotect.data import ( + NVR, + Camera, + Event, + EventType, + Sensor, + SmartDetectObjectType, +) from pyunifiprotect.data.base import WifiConnectionState, WiredConnectionState from pyunifiprotect.data.nvr import EventMetadata -from pyunifiprotect.data.types import EventType, SmartDetectObjectType from homeassistant.components.unifiprotect.const import ( ATTR_EVENT_SCORE, diff --git a/tests/components/unifiprotect/test_switch.py b/tests/components/unifiprotect/test_switch.py index 498f4c6b3b7..7918ea0b6cf 100644 --- a/tests/components/unifiprotect/test_switch.py +++ b/tests/components/unifiprotect/test_switch.py @@ -5,8 +5,13 @@ from __future__ import annotations from unittest.mock import AsyncMock, Mock import pytest -from pyunifiprotect.data import Camera, Light -from pyunifiprotect.data.types import RecordingMode, SmartDetectObjectType, VideoMode +from pyunifiprotect.data import ( + Camera, + Light, + RecordingMode, + SmartDetectObjectType, + VideoMode, +) from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION from homeassistant.components.unifiprotect.switch import (