refactoring

This commit is contained in:
Maxim Devaev
2025-02-10 00:06:49 +02:00
parent 97b405297b
commit 6ffaa8d6bd
6 changed files with 53 additions and 53 deletions

View File

@@ -99,9 +99,9 @@ class FanInfoSubmanager(BaseInfoSubmanager):
async def __get_fan_state(self) -> (dict | None):
try:
async with self.__make_http_session() as session:
async with session.get("http://localhost/state") as response:
htclient.raise_not_200(response)
return (await response.json())["result"]
async with session.get("http://localhost/state") as resp:
htclient.raise_not_200(resp)
return (await resp.json())["result"]
except Exception as ex:
get_logger(0).error("Can't read fan state: %s", ex)
return None