mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Bump pyloadapi to v1.2.0 (#120218)
This commit is contained in:
parent
bc45dcbad3
commit
f0d5640f5d
@ -6,5 +6,5 @@
|
||||
"integration_type": "service",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["pyloadapi"],
|
||||
"requirements": ["PyLoadAPI==1.1.0"]
|
||||
"requirements": ["PyLoadAPI==1.2.0"]
|
||||
}
|
||||
|
@ -6,11 +6,15 @@ from datetime import timedelta
|
||||
from enum import StrEnum
|
||||
import logging
|
||||
from time import monotonic
|
||||
from typing import Any
|
||||
|
||||
from aiohttp import CookieJar
|
||||
from pyloadapi.api import PyLoadAPI
|
||||
from pyloadapi.exceptions import CannotConnect, InvalidAuth, ParserError
|
||||
from pyloadapi import (
|
||||
CannotConnect,
|
||||
InvalidAuth,
|
||||
ParserError,
|
||||
PyLoadAPI,
|
||||
StatusServerResponse,
|
||||
)
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
@ -132,7 +136,7 @@ class PyLoadSensor(SensorEntity):
|
||||
self.api = api
|
||||
self.entity_description = entity_description
|
||||
self._attr_available = False
|
||||
self.data: dict[str, Any] = {}
|
||||
self.data: StatusServerResponse
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Update state of sensor."""
|
||||
@ -167,7 +171,7 @@ class PyLoadSensor(SensorEntity):
|
||||
self._attr_available = False
|
||||
return
|
||||
else:
|
||||
self.data = status.to_dict()
|
||||
self.data = status
|
||||
_LOGGER.debug(
|
||||
"Finished fetching pyload data in %.3f seconds",
|
||||
monotonic() - start,
|
||||
|
@ -60,7 +60,7 @@ PyFlume==0.6.5
|
||||
PyFronius==0.7.3
|
||||
|
||||
# homeassistant.components.pyload
|
||||
PyLoadAPI==1.1.0
|
||||
PyLoadAPI==1.2.0
|
||||
|
||||
# homeassistant.components.mvglive
|
||||
PyMVGLive==1.1.4
|
||||
|
@ -51,7 +51,7 @@ PyFlume==0.6.5
|
||||
PyFronius==0.7.3
|
||||
|
||||
# homeassistant.components.pyload
|
||||
PyLoadAPI==1.1.0
|
||||
PyLoadAPI==1.2.0
|
||||
|
||||
# homeassistant.components.met_eireann
|
||||
PyMetEireann==2021.8.0
|
||||
|
@ -47,7 +47,7 @@ def mock_pyloadapi() -> Generator[AsyncMock, None, None]:
|
||||
):
|
||||
client = mock_client.return_value
|
||||
client.username = "username"
|
||||
client.login.return_value = LoginResponse.from_dict(
|
||||
client.login.return_value = LoginResponse(
|
||||
{
|
||||
"_permanent": True,
|
||||
"authenticated": True,
|
||||
@ -59,7 +59,8 @@ def mock_pyloadapi() -> Generator[AsyncMock, None, None]:
|
||||
"_flashes": [["message", "Logged in successfully"]],
|
||||
}
|
||||
)
|
||||
client.get_status.return_value = StatusServerResponse.from_dict(
|
||||
|
||||
client.get_status.return_value = StatusServerResponse(
|
||||
{
|
||||
"pause": False,
|
||||
"active": 1,
|
||||
@ -71,5 +72,6 @@ def mock_pyloadapi() -> Generator[AsyncMock, None, None]:
|
||||
"captcha": False,
|
||||
}
|
||||
)
|
||||
|
||||
client.free_space.return_value = 99999999999
|
||||
yield client
|
||||
|
Loading…
x
Reference in New Issue
Block a user