Switch unifiprotect lib to use uiprotect (#119243)
This commit is contained in:
parent
b70a33a718
commit
d657feafa6
49 changed files with 94 additions and 107 deletions
|
@ -6,14 +6,14 @@ from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aiohttp.client_exceptions import ServerDisconnectedError
|
from aiohttp.client_exceptions import ServerDisconnectedError
|
||||||
from pyunifiprotect.data import Bootstrap
|
from uiprotect.data import Bootstrap
|
||||||
from pyunifiprotect.data.types import FirmwareReleaseChannel
|
from uiprotect.data.types import FirmwareReleaseChannel
|
||||||
from pyunifiprotect.exceptions import ClientError, NotAuthorized
|
from uiprotect.exceptions import ClientError, NotAuthorized
|
||||||
|
|
||||||
# Import the test_util.anonymize module from the pyunifiprotect package
|
# Import the test_util.anonymize module from the uiprotect package
|
||||||
# in __init__ to ensure it gets imported in the executor since the
|
# in __init__ to ensure it gets imported in the executor since the
|
||||||
# diagnostics module will not be imported in the executor.
|
# diagnostics module will not be imported in the executor.
|
||||||
from pyunifiprotect.test_util.anonymize import anonymize_data # noqa: F401
|
from uiprotect.test_util.anonymize import anonymize_data # noqa: F401
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||||
|
|
|
@ -6,7 +6,7 @@ import dataclasses
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Camera,
|
Camera,
|
||||||
Light,
|
Light,
|
||||||
|
@ -16,7 +16,7 @@ from pyunifiprotect.data import (
|
||||||
ProtectModelWithId,
|
ProtectModelWithId,
|
||||||
Sensor,
|
Sensor,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.data.nvr import UOSDisk
|
from uiprotect.data.nvr import UOSDisk
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
BinarySensorDeviceClass,
|
BinarySensorDeviceClass,
|
||||||
|
|
|
@ -6,7 +6,7 @@ from dataclasses import dataclass
|
||||||
import logging
|
import logging
|
||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
from pyunifiprotect.data import ProtectAdoptableDeviceModel, ProtectModelWithId
|
from uiprotect.data import ProtectAdoptableDeviceModel, ProtectModelWithId
|
||||||
|
|
||||||
from homeassistant.components.button import (
|
from homeassistant.components.button import (
|
||||||
ButtonDeviceClass,
|
ButtonDeviceClass,
|
||||||
|
|
|
@ -5,7 +5,8 @@ from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from typing_extensions import Generator
|
||||||
|
from uiprotect.data import (
|
||||||
Camera as UFPCamera,
|
Camera as UFPCamera,
|
||||||
CameraChannel,
|
CameraChannel,
|
||||||
ModelType,
|
ModelType,
|
||||||
|
@ -13,7 +14,6 @@ from pyunifiprotect.data import (
|
||||||
ProtectModelWithId,
|
ProtectModelWithId,
|
||||||
StateType,
|
StateType,
|
||||||
)
|
)
|
||||||
from typing_extensions import Generator
|
|
||||||
|
|
||||||
from homeassistant.components.camera import Camera, CameraEntityFeature
|
from homeassistant.components.camera import Camera, CameraEntityFeature
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
|
|
@ -8,9 +8,9 @@ from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import CookieJar
|
from aiohttp import CookieJar
|
||||||
from pyunifiprotect import ProtectApiClient
|
from uiprotect import ProtectApiClient
|
||||||
from pyunifiprotect.data import NVR
|
from uiprotect.data import NVR
|
||||||
from pyunifiprotect.exceptions import ClientError, NotAuthorized
|
from uiprotect.exceptions import ClientError, NotAuthorized
|
||||||
from unifi_discovery import async_console_is_alive
|
from unifi_discovery import async_console_is_alive
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constant definitions for UniFi Protect Integration."""
|
"""Constant definitions for UniFi Protect Integration."""
|
||||||
|
|
||||||
from pyunifiprotect.data import ModelType, Version
|
from uiprotect.data import ModelType, Version
|
||||||
|
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,9 @@ from functools import partial
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect import ProtectApiClient
|
from typing_extensions import Generator
|
||||||
from pyunifiprotect.data import (
|
from uiprotect import ProtectApiClient
|
||||||
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Bootstrap,
|
Bootstrap,
|
||||||
Camera,
|
Camera,
|
||||||
|
@ -20,9 +21,8 @@ from pyunifiprotect.data import (
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
WSSubscriptionMessage,
|
WSSubscriptionMessage,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.exceptions import ClientError, NotAuthorized
|
from uiprotect.exceptions import ClientError, NotAuthorized
|
||||||
from pyunifiprotect.utils import log_event
|
from uiprotect.utils import log_event
|
||||||
from typing_extensions import Generator
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect.test_util.anonymize import anonymize_data
|
from uiprotect.test_util.anonymize import anonymize_data
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
|
@ -6,7 +6,7 @@ from collections.abc import Callable, Sequence
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Camera,
|
Camera,
|
||||||
Chime,
|
Chime,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Light,
|
Light,
|
||||||
ModelType,
|
ModelType,
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Doorlock,
|
Doorlock,
|
||||||
LockStatusType,
|
LockStatusType,
|
||||||
ModelType,
|
ModelType,
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
"documentation": "https://www.home-assistant.io/integrations/unifiprotect",
|
"documentation": "https://www.home-assistant.io/integrations/unifiprotect",
|
||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["pyunifiprotect", "unifi_discovery"],
|
"loggers": ["uiprotect", "unifi_discovery"],
|
||||||
"requirements": ["pyunifiprotect==5.1.2", "unifi-discovery==1.1.8"],
|
"requirements": ["uiprotect==0.3.9", "unifi-discovery==1.1.8"],
|
||||||
"ssdp": [
|
"ssdp": [
|
||||||
{
|
{
|
||||||
"manufacturer": "Ubiquiti Networks",
|
"manufacturer": "Ubiquiti Networks",
|
||||||
|
|
|
@ -5,14 +5,14 @@ from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Camera,
|
Camera,
|
||||||
ModelType,
|
ModelType,
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
ProtectModelWithId,
|
ProtectModelWithId,
|
||||||
StateType,
|
StateType,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.exceptions import StreamError
|
from uiprotect.exceptions import StreamError
|
||||||
|
|
||||||
from homeassistant.components import media_source
|
from homeassistant.components import media_source
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
|
|
|
@ -7,15 +7,9 @@ from datetime import date, datetime, timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, NoReturn, cast
|
from typing import Any, NoReturn, cast
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import Camera, Event, EventType, ModelType, SmartDetectObjectType
|
||||||
Camera,
|
from uiprotect.exceptions import NvrError
|
||||||
Event,
|
from uiprotect.utils import from_js_time
|
||||||
EventType,
|
|
||||||
ModelType,
|
|
||||||
SmartDetectObjectType,
|
|
||||||
)
|
|
||||||
from pyunifiprotect.exceptions import NvrError
|
|
||||||
from pyunifiprotect.utils import from_js_time
|
|
||||||
from yarl import URL
|
from yarl import URL
|
||||||
|
|
||||||
from homeassistant.components.camera import CameraImageView
|
from homeassistant.components.camera import CameraImageView
|
||||||
|
|
|
@ -6,8 +6,8 @@ from itertools import chain
|
||||||
import logging
|
import logging
|
||||||
from typing import TypedDict
|
from typing import TypedDict
|
||||||
|
|
||||||
from pyunifiprotect import ProtectApiClient
|
from uiprotect import ProtectApiClient
|
||||||
from pyunifiprotect.data import Bootstrap
|
from uiprotect.data import Bootstrap
|
||||||
|
|
||||||
from homeassistant.components.automation import automations_with_entity
|
from homeassistant.components.automation import automations_with_entity
|
||||||
from homeassistant.components.script import scripts_with_entity
|
from homeassistant.components.script import scripts_with_entity
|
||||||
|
|
|
@ -8,7 +8,7 @@ from enum import Enum
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any, Generic, TypeVar
|
from typing import TYPE_CHECKING, Any, Generic, TypeVar
|
||||||
|
|
||||||
from pyunifiprotect.data import NVR, Event, ProtectAdoptableDeviceModel
|
from uiprotect.data import NVR, Event, ProtectAdoptableDeviceModel
|
||||||
|
|
||||||
from homeassistant.helpers.entity import EntityDescription
|
from homeassistant.helpers.entity import EntityDescription
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Camera,
|
Camera,
|
||||||
Doorlock,
|
Doorlock,
|
||||||
Light,
|
Light,
|
||||||
|
|
|
@ -4,9 +4,9 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
from pyunifiprotect import ProtectApiClient
|
from uiprotect import ProtectApiClient
|
||||||
from pyunifiprotect.data import Bootstrap, Camera, ModelType
|
from uiprotect.data import Bootstrap, Camera, ModelType
|
||||||
from pyunifiprotect.data.types import FirmwareReleaseChannel
|
from uiprotect.data.types import FirmwareReleaseChannel
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import data_entry_flow
|
from homeassistant import data_entry_flow
|
||||||
|
|
|
@ -8,8 +8,8 @@ from enum import Enum
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Final
|
from typing import Any, Final
|
||||||
|
|
||||||
from pyunifiprotect.api import ProtectApiClient
|
from uiprotect.api import ProtectApiClient
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Camera,
|
Camera,
|
||||||
ChimeType,
|
ChimeType,
|
||||||
DoorbellMessageType,
|
DoorbellMessageType,
|
||||||
|
|
|
@ -7,7 +7,7 @@ from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Camera,
|
Camera,
|
||||||
Light,
|
Light,
|
||||||
|
|
|
@ -7,9 +7,9 @@ import functools
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
from pyunifiprotect.api import ProtectApiClient
|
from uiprotect.api import ProtectApiClient
|
||||||
from pyunifiprotect.data import Camera, Chime
|
from uiprotect.data import Camera, Chime
|
||||||
from pyunifiprotect.exceptions import ClientError
|
from uiprotect.exceptions import ClientError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
|
|
|
@ -6,7 +6,7 @@ from dataclasses import dataclass
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Camera,
|
Camera,
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Camera,
|
Camera,
|
||||||
DoorbellMessageType,
|
DoorbellMessageType,
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
|
|
|
@ -10,8 +10,9 @@ import socket
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import CookieJar
|
from aiohttp import CookieJar
|
||||||
from pyunifiprotect import ProtectApiClient
|
from typing_extensions import Generator
|
||||||
from pyunifiprotect.data import (
|
from uiprotect import ProtectApiClient
|
||||||
|
from uiprotect.data import (
|
||||||
Bootstrap,
|
Bootstrap,
|
||||||
CameraChannel,
|
CameraChannel,
|
||||||
Light,
|
Light,
|
||||||
|
@ -19,7 +20,6 @@ from pyunifiprotect.data import (
|
||||||
LightModeType,
|
LightModeType,
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
)
|
)
|
||||||
from typing_extensions import Generator
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
|
|
@ -9,8 +9,8 @@ from typing import Any
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from pyunifiprotect.data import Camera, Event
|
from uiprotect.data import Camera, Event
|
||||||
from pyunifiprotect.exceptions import ClientError
|
from uiprotect.exceptions import ClientError
|
||||||
|
|
||||||
from homeassistant.components.http import HomeAssistantView
|
from homeassistant.components.http import HomeAssistantView
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
|
|
@ -2363,9 +2363,6 @@ pytrydan==0.7.0
|
||||||
# homeassistant.components.usb
|
# homeassistant.components.usb
|
||||||
pyudev==0.24.1
|
pyudev==0.24.1
|
||||||
|
|
||||||
# homeassistant.components.unifiprotect
|
|
||||||
pyunifiprotect==5.1.2
|
|
||||||
|
|
||||||
# homeassistant.components.uptimerobot
|
# homeassistant.components.uptimerobot
|
||||||
pyuptimerobot==22.2.0
|
pyuptimerobot==22.2.0
|
||||||
|
|
||||||
|
@ -2787,6 +2784,9 @@ twitchAPI==4.0.0
|
||||||
# homeassistant.components.ukraine_alarm
|
# homeassistant.components.ukraine_alarm
|
||||||
uasiren==0.0.1
|
uasiren==0.0.1
|
||||||
|
|
||||||
|
# homeassistant.components.unifiprotect
|
||||||
|
uiprotect==0.3.9
|
||||||
|
|
||||||
# homeassistant.components.landisgyr_heat_meter
|
# homeassistant.components.landisgyr_heat_meter
|
||||||
ultraheat-api==0.5.7
|
ultraheat-api==0.5.7
|
||||||
|
|
||||||
|
|
|
@ -1848,9 +1848,6 @@ pytrydan==0.7.0
|
||||||
# homeassistant.components.usb
|
# homeassistant.components.usb
|
||||||
pyudev==0.24.1
|
pyudev==0.24.1
|
||||||
|
|
||||||
# homeassistant.components.unifiprotect
|
|
||||||
pyunifiprotect==5.1.2
|
|
||||||
|
|
||||||
# homeassistant.components.uptimerobot
|
# homeassistant.components.uptimerobot
|
||||||
pyuptimerobot==22.2.0
|
pyuptimerobot==22.2.0
|
||||||
|
|
||||||
|
@ -2167,6 +2164,9 @@ twitchAPI==4.0.0
|
||||||
# homeassistant.components.ukraine_alarm
|
# homeassistant.components.ukraine_alarm
|
||||||
uasiren==0.0.1
|
uasiren==0.0.1
|
||||||
|
|
||||||
|
# homeassistant.components.unifiprotect
|
||||||
|
uiprotect==0.3.9
|
||||||
|
|
||||||
# homeassistant.components.landisgyr_heat_meter
|
# homeassistant.components.landisgyr_heat_meter
|
||||||
ultraheat-api==0.5.7
|
ultraheat-api==0.5.7
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ from typing import Any
|
||||||
from unittest.mock import AsyncMock, Mock, patch
|
from unittest.mock import AsyncMock, Mock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect import ProtectApiClient
|
from uiprotect import ProtectApiClient
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
NVR,
|
NVR,
|
||||||
Bootstrap,
|
Bootstrap,
|
||||||
Camera,
|
Camera,
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import annotations
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera, Event, EventType, Light, MountType, Sensor
|
from uiprotect.data import Camera, Event, EventType, Light, MountType, Sensor
|
||||||
from pyunifiprotect.data.nvr import EventMetadata
|
from uiprotect.data.nvr import EventMetadata
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||||
from homeassistant.components.unifiprotect.binary_sensor import (
|
from homeassistant.components.unifiprotect.binary_sensor import (
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data.devices import Camera, Chime, Doorlock
|
from uiprotect.data.devices import Camera, Chime, Doorlock
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ENTITY_ID, Platform
|
from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ENTITY_ID, Platform
|
||||||
|
|
|
@ -4,8 +4,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera as ProtectCamera, CameraChannel, StateType
|
from uiprotect.data import Camera as ProtectCamera, CameraChannel, StateType
|
||||||
from pyunifiprotect.exceptions import NvrError
|
from uiprotect.exceptions import NvrError
|
||||||
|
|
||||||
from homeassistant.components.camera import (
|
from homeassistant.components.camera import (
|
||||||
CameraEntityFeature,
|
CameraEntityFeature,
|
||||||
|
|
|
@ -7,8 +7,8 @@ import socket
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect import NotAuthorized, NvrError, ProtectApiClient
|
from uiprotect import NotAuthorized, NvrError, ProtectApiClient
|
||||||
from pyunifiprotect.data import NVR, Bootstrap, CloudAccount
|
from uiprotect.data import NVR, Bootstrap, CloudAccount
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components import dhcp, ssdp
|
from homeassistant.components import dhcp, ssdp
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Test UniFi Protect diagnostics."""
|
"""Test UniFi Protect diagnostics."""
|
||||||
|
|
||||||
from pyunifiprotect.data import NVR, Light
|
from uiprotect.data import NVR, Light
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import CONF_ALLOW_EA
|
from homeassistant.components.unifiprotect.const import CONF_ALLOW_EA
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
|
@ -4,8 +4,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
from pyunifiprotect import NotAuthorized, NvrError, ProtectApiClient
|
from uiprotect import NotAuthorized, NvrError, ProtectApiClient
|
||||||
from pyunifiprotect.data import NVR, Bootstrap, CloudAccount, Light
|
from uiprotect.data import NVR, Bootstrap, CloudAccount, Light
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import (
|
from homeassistant.components.unifiprotect.const import (
|
||||||
AUTH_RETRIES,
|
AUTH_RETRIES,
|
||||||
|
|
|
@ -4,8 +4,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Light
|
from uiprotect.data import Light
|
||||||
from pyunifiprotect.data.types import LEDLevel
|
from uiprotect.data.types import LEDLevel
|
||||||
|
|
||||||
from homeassistant.components.light import ATTR_BRIGHTNESS
|
from homeassistant.components.light import ATTR_BRIGHTNESS
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Doorlock, LockStatusType
|
from uiprotect.data import Doorlock, LockStatusType
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
|
|
@ -5,8 +5,8 @@ from __future__ import annotations
|
||||||
from unittest.mock import AsyncMock, Mock, patch
|
from unittest.mock import AsyncMock, Mock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import Camera
|
from uiprotect.data import Camera
|
||||||
from pyunifiprotect.exceptions import StreamError
|
from uiprotect.exceptions import StreamError
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
ATTR_MEDIA_CONTENT_TYPE,
|
ATTR_MEDIA_CONTENT_TYPE,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from ipaddress import IPv4Address
|
||||||
from unittest.mock import AsyncMock, Mock, patch
|
from unittest.mock import AsyncMock, Mock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Bootstrap,
|
Bootstrap,
|
||||||
Camera,
|
Camera,
|
||||||
Event,
|
Event,
|
||||||
|
@ -13,7 +13,7 @@ from pyunifiprotect.data import (
|
||||||
Permission,
|
Permission,
|
||||||
SmartDetectObjectType,
|
SmartDetectObjectType,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.exceptions import NvrError
|
from uiprotect.exceptions import NvrError
|
||||||
|
|
||||||
from homeassistant.components.media_player import BrowseError, MediaClass
|
from homeassistant.components.media_player import BrowseError, MediaClass
|
||||||
from homeassistant.components.media_source import MediaSourceItem
|
from homeassistant.components.media_source import MediaSourceItem
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera
|
from uiprotect.data import Camera
|
||||||
|
|
||||||
from homeassistant.components.automation import DOMAIN as AUTOMATION_DOMAIN
|
from homeassistant.components.automation import DOMAIN as AUTOMATION_DOMAIN
|
||||||
from homeassistant.components.repairs.issue_handler import (
|
from homeassistant.components.repairs.issue_handler import (
|
||||||
|
|
|
@ -6,7 +6,7 @@ from datetime import timedelta
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import Camera, Doorlock, IRLEDMode, Light
|
from uiprotect.data import Camera, Doorlock, IRLEDMode, Light
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.components.unifiprotect.number import (
|
from homeassistant.components.unifiprotect.number import (
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera, Event, EventType
|
from uiprotect.data import Camera, Event, EventType
|
||||||
|
|
||||||
from homeassistant.components.recorder import Recorder
|
from homeassistant.components.recorder import Recorder
|
||||||
from homeassistant.components.recorder.history import get_significant_states
|
from homeassistant.components.recorder.history import get_significant_states
|
||||||
|
|
|
@ -6,7 +6,7 @@ from copy import copy, deepcopy
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera, CloudAccount, ModelType, Version
|
from uiprotect.data import Camera, CloudAccount, ModelType, Version
|
||||||
|
|
||||||
from homeassistant.components.repairs.issue_handler import (
|
from homeassistant.components.repairs.issue_handler import (
|
||||||
async_process_repairs_platforms,
|
async_process_repairs_platforms,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Camera,
|
Camera,
|
||||||
DoorbellMessageType,
|
DoorbellMessageType,
|
||||||
IRLEDMode,
|
IRLEDMode,
|
||||||
|
@ -17,7 +17,7 @@ from pyunifiprotect.data import (
|
||||||
RecordingMode,
|
RecordingMode,
|
||||||
Viewer,
|
Viewer,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.data.nvr import DoorbellMessage
|
from uiprotect.data.nvr import DoorbellMessage
|
||||||
|
|
||||||
from homeassistant.components.select import ATTR_OPTIONS
|
from homeassistant.components.select import ATTR_OPTIONS
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
|
|
|
@ -6,15 +6,8 @@ from datetime import datetime, timedelta
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import NVR, Camera, Event, EventType, Sensor, SmartDetectObjectType
|
||||||
NVR,
|
from uiprotect.data.nvr import EventMetadata, LicensePlateMetadata
|
||||||
Camera,
|
|
||||||
Event,
|
|
||||||
EventType,
|
|
||||||
Sensor,
|
|
||||||
SmartDetectObjectType,
|
|
||||||
)
|
|
||||||
from pyunifiprotect.data.nvr import EventMetadata, LicensePlateMetadata
|
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.components.unifiprotect.sensor import (
|
from homeassistant.components.unifiprotect.sensor import (
|
||||||
|
|
|
@ -5,9 +5,9 @@ from __future__ import annotations
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import Camera, Chime, Color, Light, ModelType
|
from uiprotect.data import Camera, Chime, Color, Light, ModelType
|
||||||
from pyunifiprotect.data.devices import CameraZone
|
from uiprotect.data.devices import CameraZone
|
||||||
from pyunifiprotect.exceptions import BadRequest
|
from uiprotect.exceptions import BadRequest
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import ATTR_MESSAGE, DOMAIN
|
from homeassistant.components.unifiprotect.const import ATTR_MESSAGE, DOMAIN
|
||||||
from homeassistant.components.unifiprotect.services import (
|
from homeassistant.components.unifiprotect.services import (
|
||||||
|
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import Camera, Light, Permission, RecordingMode, VideoMode
|
from uiprotect.data import Camera, Light, Permission, RecordingMode, VideoMode
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.components.unifiprotect.switch import (
|
from homeassistant.components.unifiprotect.switch import (
|
||||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from unittest.mock import AsyncMock, Mock
|
from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from pyunifiprotect.data import Camera, DoorbellMessageType, LCDMessage
|
from uiprotect.data import Camera, DoorbellMessageType, LCDMessage
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
from homeassistant.components.unifiprotect.const import DEFAULT_ATTRIBUTION
|
||||||
from homeassistant.components.unifiprotect.text import CAMERA
|
from homeassistant.components.unifiprotect.text import CAMERA
|
||||||
|
|
|
@ -6,8 +6,8 @@ from unittest.mock import AsyncMock, Mock
|
||||||
|
|
||||||
from aiohttp import ClientResponse
|
from aiohttp import ClientResponse
|
||||||
import pytest
|
import pytest
|
||||||
from pyunifiprotect.data import Camera, Event, EventType
|
from uiprotect.data import Camera, Event, EventType
|
||||||
from pyunifiprotect.exceptions import ClientError
|
from uiprotect.exceptions import ClientError
|
||||||
|
|
||||||
from homeassistant.components.unifiprotect.views import (
|
from homeassistant.components.unifiprotect.views import (
|
||||||
async_generate_event_video_url,
|
async_generate_event_video_url,
|
||||||
|
|
|
@ -8,8 +8,8 @@ from datetime import timedelta
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
from pyunifiprotect import ProtectApiClient
|
from uiprotect import ProtectApiClient
|
||||||
from pyunifiprotect.data import (
|
from uiprotect.data import (
|
||||||
Bootstrap,
|
Bootstrap,
|
||||||
Camera,
|
Camera,
|
||||||
Event,
|
Event,
|
||||||
|
@ -18,8 +18,8 @@ from pyunifiprotect.data import (
|
||||||
ProtectAdoptableDeviceModel,
|
ProtectAdoptableDeviceModel,
|
||||||
WSSubscriptionMessage,
|
WSSubscriptionMessage,
|
||||||
)
|
)
|
||||||
from pyunifiprotect.data.bootstrap import ProtectDeviceRef
|
from uiprotect.data.bootstrap import ProtectDeviceRef
|
||||||
from pyunifiprotect.test_util.anonymize import random_hex
|
from uiprotect.test_util.anonymize import random_hex
|
||||||
|
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant, split_entity_id
|
from homeassistant.core import HomeAssistant, split_entity_id
|
||||||
|
|
Loading…
Add table
Reference in a new issue