Bump async_upnp_client to 0.39.0 (#120250)
parent
480ffeda2c
commit
55a2645e78
|
@ -8,7 +8,7 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/dlna_dmr",
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["async_upnp_client"],
|
||||
"requirements": ["async-upnp-client==0.38.3", "getmac==0.9.4"],
|
||||
"requirements": ["async-upnp-client==0.39.0", "getmac==0.9.4"],
|
||||
"ssdp": [
|
||||
{
|
||||
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/dlna_dms",
|
||||
"iot_class": "local_polling",
|
||||
"quality_scale": "platinum",
|
||||
"requirements": ["async-upnp-client==0.38.3"],
|
||||
"requirements": ["async-upnp-client==0.39.0"],
|
||||
"ssdp": [
|
||||
{
|
||||
"deviceType": "urn:schemas-upnp-org:device:MediaServer:1",
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"samsungctl[websocket]==0.7.1",
|
||||
"samsungtvws[async,encrypted]==2.6.0",
|
||||
"wakeonlan==2.1.0",
|
||||
"async-upnp-client==0.38.3"
|
||||
"async-upnp-client==0.39.0"
|
||||
],
|
||||
"ssdp": [
|
||||
{
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
"iot_class": "local_push",
|
||||
"loggers": ["async_upnp_client"],
|
||||
"quality_scale": "internal",
|
||||
"requirements": ["async-upnp-client==0.38.3"]
|
||||
"requirements": ["async-upnp-client==0.39.0"]
|
||||
}
|
||||
|
|
|
@ -154,14 +154,9 @@ class Device:
|
|||
async def async_get_data(self) -> dict[str, str | datetime | int | float | None]:
|
||||
"""Get all data from device."""
|
||||
_LOGGER.debug("Getting data for device: %s", self)
|
||||
igd_state = await self._igd_device.async_get_traffic_and_status_data()
|
||||
status_info = igd_state.status_info
|
||||
if status_info is not None and not isinstance(status_info, BaseException):
|
||||
wan_status = status_info.connection_status
|
||||
router_uptime = status_info.uptime
|
||||
else:
|
||||
wan_status = None
|
||||
router_uptime = None
|
||||
igd_state = await self._igd_device.async_get_traffic_and_status_data(
|
||||
force_poll=True
|
||||
)
|
||||
|
||||
def get_value(value: Any) -> Any:
|
||||
if value is None or isinstance(value, BaseException):
|
||||
|
@ -175,8 +170,8 @@ class Device:
|
|||
BYTES_SENT: get_value(igd_state.bytes_sent),
|
||||
PACKETS_RECEIVED: get_value(igd_state.packets_received),
|
||||
PACKETS_SENT: get_value(igd_state.packets_sent),
|
||||
WAN_STATUS: wan_status,
|
||||
ROUTER_UPTIME: router_uptime,
|
||||
WAN_STATUS: get_value(igd_state.connection_status),
|
||||
ROUTER_UPTIME: get_value(igd_state.uptime),
|
||||
ROUTER_IP: get_value(igd_state.external_ip_address),
|
||||
KIBIBYTES_PER_SEC_RECEIVED: igd_state.kibibytes_per_sec_received,
|
||||
KIBIBYTES_PER_SEC_SENT: igd_state.kibibytes_per_sec_sent,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"integration_type": "device",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["async_upnp_client"],
|
||||
"requirements": ["async-upnp-client==0.38.3", "getmac==0.9.4"],
|
||||
"requirements": ["async-upnp-client==0.39.0", "getmac==0.9.4"],
|
||||
"ssdp": [
|
||||
{
|
||||
"st": "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"iot_class": "local_push",
|
||||
"loggers": ["async_upnp_client", "yeelight"],
|
||||
"quality_scale": "platinum",
|
||||
"requirements": ["yeelight==0.7.14", "async-upnp-client==0.38.3"],
|
||||
"requirements": ["yeelight==0.7.14", "async-upnp-client==0.39.0"],
|
||||
"zeroconf": [
|
||||
{
|
||||
"type": "_miio._udp.local.",
|
||||
|
|
|
@ -10,7 +10,7 @@ aiohttp_cors==0.7.0
|
|||
aiozoneinfo==0.2.0
|
||||
astral==2.2
|
||||
async-interrupt==1.1.1
|
||||
async-upnp-client==0.38.3
|
||||
async-upnp-client==0.39.0
|
||||
atomicwrites-homeassistant==1.4.1
|
||||
attrs==23.2.0
|
||||
awesomeversion==24.2.0
|
||||
|
|
|
@ -490,7 +490,7 @@ asterisk_mbox==0.5.0
|
|||
# homeassistant.components.ssdp
|
||||
# homeassistant.components.upnp
|
||||
# homeassistant.components.yeelight
|
||||
async-upnp-client==0.38.3
|
||||
async-upnp-client==0.39.0
|
||||
|
||||
# homeassistant.components.arve
|
||||
asyncarve==0.0.9
|
||||
|
|
|
@ -445,7 +445,7 @@ asterisk_mbox==0.5.0
|
|||
# homeassistant.components.ssdp
|
||||
# homeassistant.components.upnp
|
||||
# homeassistant.components.yeelight
|
||||
async-upnp-client==0.38.3
|
||||
async-upnp-client==0.39.0
|
||||
|
||||
# homeassistant.components.arve
|
||||
asyncarve==0.0.9
|
||||
|
|
|
@ -72,6 +72,7 @@ def domain_data_mock(hass: HomeAssistant) -> Iterable[Mock]:
|
|||
service_id="urn:upnp-org:serviceId:RenderingControl",
|
||||
),
|
||||
}
|
||||
upnp_device.all_services = list(upnp_device.services.values())
|
||||
seal(upnp_device)
|
||||
domain_data.upnp_factory.async_create_device.return_value = upnp_device
|
||||
|
||||
|
|
|
@ -238,7 +238,9 @@ async def test_user_flow_embedded_st(
|
|||
embedded_device.device_type = MOCK_DEVICE_TYPE
|
||||
embedded_device.name = MOCK_DEVICE_NAME
|
||||
embedded_device.services = upnp_device.services
|
||||
embedded_device.all_services = upnp_device.all_services
|
||||
upnp_device.services = {}
|
||||
upnp_device.all_services = []
|
||||
upnp_device.all_devices.append(embedded_device)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
|
|
@ -8,7 +8,7 @@ from unittest.mock import AsyncMock, MagicMock, PropertyMock, create_autospec, p
|
|||
from urllib.parse import urlparse
|
||||
|
||||
from async_upnp_client.client import UpnpDevice
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState, StatusInfo
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import ssdp
|
||||
|
@ -87,16 +87,15 @@ def mock_igd_device(mock_async_create_device) -> IgdDevice:
|
|||
bytes_sent=0,
|
||||
packets_received=0,
|
||||
packets_sent=0,
|
||||
status_info=StatusInfo(
|
||||
"Connected",
|
||||
"",
|
||||
10,
|
||||
),
|
||||
connection_status="Connected",
|
||||
last_connection_error="",
|
||||
uptime=10,
|
||||
external_ip_address="8.9.10.11",
|
||||
kibibytes_per_sec_received=None,
|
||||
kibibytes_per_sec_sent=None,
|
||||
packets_per_sec_received=None,
|
||||
packets_per_sec_sent=None,
|
||||
port_mapping_number_of_entries=0,
|
||||
)
|
||||
|
||||
with patch(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState, StatusInfo
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState
|
||||
|
||||
from homeassistant.components.upnp.const import DEFAULT_SCAN_INTERVAL
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -27,16 +27,15 @@ async def test_upnp_binary_sensors(
|
|||
bytes_sent=0,
|
||||
packets_received=0,
|
||||
packets_sent=0,
|
||||
status_info=StatusInfo(
|
||||
"Disconnected",
|
||||
"",
|
||||
40,
|
||||
),
|
||||
connection_status="Disconnected",
|
||||
last_connection_error="",
|
||||
uptime=40,
|
||||
external_ip_address="8.9.10.11",
|
||||
kibibytes_per_sec_received=None,
|
||||
kibibytes_per_sec_sent=None,
|
||||
packets_per_sec_received=None,
|
||||
packets_per_sec_sent=None,
|
||||
port_mapping_number_of_entries=0,
|
||||
)
|
||||
|
||||
async_fire_time_changed(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState, StatusInfo
|
||||
from async_upnp_client.profiles.igd import IgdDevice, IgdState
|
||||
|
||||
from homeassistant.components.upnp.const import DEFAULT_SCAN_INTERVAL
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -35,16 +35,15 @@ async def test_upnp_sensors(
|
|||
bytes_sent=20480,
|
||||
packets_received=30,
|
||||
packets_sent=40,
|
||||
status_info=StatusInfo(
|
||||
"Disconnected",
|
||||
"",
|
||||
40,
|
||||
),
|
||||
connection_status="Disconnected",
|
||||
last_connection_error="",
|
||||
uptime=40,
|
||||
external_ip_address="",
|
||||
kibibytes_per_sec_received=10.0,
|
||||
kibibytes_per_sec_sent=20.0,
|
||||
packets_per_sec_received=30.0,
|
||||
packets_per_sec_sent=40.0,
|
||||
port_mapping_number_of_entries=0,
|
||||
)
|
||||
|
||||
now = dt_util.utcnow()
|
||||
|
|
Loading…
Reference in New Issue