Skip to content

Commit

Permalink
Bump unifiprotect to 4.8.1 (home-assistant#91522)
Browse files Browse the repository at this point in the history
  • Loading branch information
AngellusMortis authored Apr 17, 2023
1 parent fdc80e1 commit 5dcc4d4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/unifiprotect/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from collections.abc import Mapping
import logging
from pathlib import Path
from typing import Any

from aiohttp import CookieJar
Expand All @@ -28,6 +29,7 @@
async_create_clientsession,
async_get_clientsession,
)
from homeassistant.helpers.storage import STORAGE_DIR
from homeassistant.helpers.typing import DiscoveryInfoType
from homeassistant.loader import async_get_integration
from homeassistant.util.network import is_ip_address
Expand Down Expand Up @@ -248,6 +250,7 @@ async def _async_get_nvr_data(
username=user_input[CONF_USERNAME],
password=user_input[CONF_PASSWORD],
verify_ssl=verify_ssl,
cache_dir=Path(self.hass.config.path(STORAGE_DIR, "unifiprotect_cache")),
)

errors = {}
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/unifiprotect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"iot_class": "local_push",
"loggers": ["pyunifiprotect", "unifi_discovery"],
"quality_scale": "platinum",
"requirements": ["pyunifiprotect==4.7.0", "unifi-discovery==1.1.7"],
"requirements": ["pyunifiprotect==4.8.1", "unifi-discovery==1.1.7"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/unifiprotect/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections.abc import Generator, Iterable
import contextlib
from enum import Enum
from pathlib import Path
import socket
from typing import Any

Expand All @@ -27,6 +28,7 @@
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers.storage import STORAGE_DIR

from .const import (
CONF_ALL_UPDATES,
Expand Down Expand Up @@ -142,4 +144,5 @@ def async_create_api_client(
override_connection_host=entry.options.get(CONF_OVERRIDE_CHOST, False),
ignore_stats=not entry.options.get(CONF_ALL_UPDATES, False),
ignore_unadopted=False,
cache_dir=Path(hass.config.path(STORAGE_DIR, "unifiprotect_cache")),
)
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,7 @@ pytrafikverket==0.2.3
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.7.0
pyunifiprotect==4.8.1

# homeassistant.components.uptimerobot
pyuptimerobot==22.2.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ pytrafikverket==0.2.3
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.7.0
pyunifiprotect==4.8.1

# homeassistant.components.uptimerobot
pyuptimerobot==22.2.0
Expand Down
3 changes: 3 additions & 0 deletions tests/components/unifiprotect/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from functools import partial
from ipaddress import IPv4Address
import json
from pathlib import Path
from tempfile import gettempdir
from typing import Any
from unittest.mock import AsyncMock, Mock, patch

Expand Down Expand Up @@ -105,6 +107,7 @@ def mock_ufp_client(bootstrap: Bootstrap):
client.bootstrap = bootstrap
client._bootstrap = bootstrap
client.api_path = "/api"
client.cache_dir = Path(gettempdir()) / "ufp_cache"
# functionality from API client tests actually need
client._stream_response = partial(ProtectApiClient._stream_response, client)
client.get_camera_video = partial(ProtectApiClient.get_camera_video, client)
Expand Down

0 comments on commit 5dcc4d4

Please sign in to comment.