Cleanup Discovergy a bit (#104552)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
Jan-Philipp Benecke 2023-11-26 17:32:47 +01:00 committed by GitHub
parent ad17acc6ca
commit b314df272f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 66 deletions

View file

@ -12,17 +12,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
class DiscovergyUpdateCoordinator(DataUpdateCoordinator[Reading]):
"""The Discovergy update coordinator."""
discovergy_client: Discovergy
meter: Meter
def __init__(
self,
hass: HomeAssistant,
@ -36,7 +31,7 @@ class DiscovergyUpdateCoordinator(DataUpdateCoordinator[Reading]):
super().__init__(
hass,
_LOGGER,
name=DOMAIN,
name=f"Discovergy meter {meter.meter_id}",
update_interval=timedelta(seconds=30),
)