Bump unifiprotect to 4.8.1 (#91522)

This commit is contained in:
Christopher Bailey 2023-04-16 23:50:06 -04:00 committed by GitHub
parent fdc80e14e6
commit 5dcc4d49c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 3 deletions

View file

@ -3,6 +3,7 @@ from __future__ import annotations
from collections.abc import Mapping
import logging
from pathlib import Path
from typing import Any
from aiohttp import CookieJar
@ -28,6 +29,7 @@ from homeassistant.helpers.aiohttp_client import (
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
@ -248,6 +250,7 @@ class ProtectFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
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 = {}

View file

@ -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",

View file

@ -4,6 +4,7 @@ from __future__ import annotations
from collections.abc import Generator, Iterable
import contextlib
from enum import Enum
from pathlib import Path
import socket
from typing import Any
@ -27,6 +28,7 @@ from homeassistant.const import (
)
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,
@ -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")),
)

View file

@ -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

View file

@ -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

View file

@ -7,6 +7,8 @@ from datetime import datetime, timedelta
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
@ -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)