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