mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Update pydiscovergy to 2.0.3 (#97509)
* Update pydiscovergy to 2.0.3 * Fix mypy * Fix tests
This commit is contained in:
parent
9df1805b3b
commit
dba6330fc8
@ -50,9 +50,9 @@ class DiscovergyUpdateCoordinator(DataUpdateCoordinator[Reading]):
|
|||||||
return await self.discovergy_client.meter_last_reading(self.meter.meter_id)
|
return await self.discovergy_client.meter_last_reading(self.meter.meter_id)
|
||||||
except AccessTokenExpired as err:
|
except AccessTokenExpired as err:
|
||||||
raise ConfigEntryAuthFailed(
|
raise ConfigEntryAuthFailed(
|
||||||
f"Auth expired while fetching last reading for meter {self.meter.get_meter_id()}"
|
f"Auth expired while fetching last reading for meter {self.meter.meter_id}"
|
||||||
) from err
|
) from err
|
||||||
except HTTPError as err:
|
except HTTPError as err:
|
||||||
raise UpdateFailed(
|
raise UpdateFailed(
|
||||||
f"Error while fetching last reading for meter {self.meter.get_meter_id()}"
|
f"Error while fetching last reading for meter {self.meter.meter_id}"
|
||||||
) from err
|
) from err
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Diagnostics support for discovergy."""
|
"""Diagnostics support for discovergy."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import asdict
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pydiscovergy.models import Meter
|
from pydiscovergy.models import Meter
|
||||||
@ -36,11 +37,11 @@ async def async_get_config_entry_diagnostics(
|
|||||||
|
|
||||||
for meter in meters:
|
for meter in meters:
|
||||||
# make a dict of meter data and redact some data
|
# make a dict of meter data and redact some data
|
||||||
flattened_meter.append(async_redact_data(meter.__dict__, TO_REDACT_METER))
|
flattened_meter.append(async_redact_data(asdict(meter), TO_REDACT_METER))
|
||||||
|
|
||||||
# get last reading for meter and make a dict of it
|
# get last reading for meter and make a dict of it
|
||||||
coordinator = data.coordinators[meter.meter_id]
|
coordinator = data.coordinators[meter.meter_id]
|
||||||
last_readings[meter.meter_id] = coordinator.data.__dict__
|
last_readings[meter.meter_id] = asdict(coordinator.data)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"entry": async_redact_data(entry.as_dict(), TO_REDACT_CONFIG_ENTRY),
|
"entry": async_redact_data(entry.as_dict(), TO_REDACT_CONFIG_ENTRY),
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/discovergy",
|
"documentation": "https://www.home-assistant.io/integrations/discovergy",
|
||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"requirements": ["pydiscovergy==2.0.1"]
|
"requirements": ["pydiscovergy==2.0.3"]
|
||||||
}
|
}
|
||||||
|
@ -1638,7 +1638,7 @@ pydelijn==1.1.0
|
|||||||
pydexcom==0.2.3
|
pydexcom==0.2.3
|
||||||
|
|
||||||
# homeassistant.components.discovergy
|
# homeassistant.components.discovergy
|
||||||
pydiscovergy==2.0.1
|
pydiscovergy==2.0.3
|
||||||
|
|
||||||
# homeassistant.components.doods
|
# homeassistant.components.doods
|
||||||
pydoods==1.0.2
|
pydoods==1.0.2
|
||||||
|
@ -1217,7 +1217,7 @@ pydeconz==113
|
|||||||
pydexcom==0.2.3
|
pydexcom==0.2.3
|
||||||
|
|
||||||
# homeassistant.components.discovergy
|
# homeassistant.components.discovergy
|
||||||
pydiscovergy==2.0.1
|
pydiscovergy==2.0.3
|
||||||
|
|
||||||
# homeassistant.components.android_ip_webcam
|
# homeassistant.components.android_ip_webcam
|
||||||
pydroid-ipcam==2.0.0
|
pydroid-ipcam==2.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user