Disable always_update in nexia coordinator (#97436)

This commit is contained in:
J. Nick Koston 2023-07-28 17:46:26 -05:00 committed by GitHub
parent c11222c1d0
commit 0a56361ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from nexia.home import NexiaHome
@ -14,7 +15,7 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_UPDATE_RATE = 120
class NexiaDataUpdateCoordinator(DataUpdateCoordinator[None]):
class NexiaDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"""DataUpdateCoordinator for nexia homes."""
def __init__(
@ -29,8 +30,9 @@ class NexiaDataUpdateCoordinator(DataUpdateCoordinator[None]):
_LOGGER,
name="Nexia update",
update_interval=timedelta(seconds=DEFAULT_UPDATE_RATE),
always_update=False,
)
async def _async_update_data(self) -> None:
async def _async_update_data(self) -> dict[str, Any]:
"""Fetch data from API endpoint."""
return await self.nexia_home.update()