Bump pydiscovergy to 3.0.0 (#111305)

pull/111311/head
Jan-Philipp Benecke 2024-02-24 22:07:46 +01:00 committed by GitHub
parent adf4392c0a
commit d796085923
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 10 deletions

View File

@ -38,7 +38,9 @@ class DiscovergyUpdateCoordinator(DataUpdateCoordinator[Reading]):
async def _async_update_data(self) -> Reading: async def _async_update_data(self) -> Reading:
"""Get last reading for meter.""" """Get last reading for meter."""
try: try:
return await self.discovergy_client.meter_last_reading(self.meter.meter_id) return await self.discovergy_client.meter_last_reading(
meter_id=self.meter.meter_id
)
except InvalidLogin as err: except InvalidLogin as err:
raise ConfigEntryAuthFailed( raise ConfigEntryAuthFailed(
f"Auth expired while fetching last reading for meter {self.meter.meter_id}" f"Auth expired while fetching last reading for meter {self.meter.meter_id}"

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/discovergy", "documentation": "https://www.home-assistant.io/integrations/discovergy",
"integration_type": "service", "integration_type": "service",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"requirements": ["pydiscovergy==2.0.5"] "requirements": ["pydiscovergy==3.0.0"]
} }

View File

@ -156,7 +156,7 @@ ADDITIONAL_SENSORS: tuple[DiscovergySensorEntityDescription, ...] = (
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
value_fn=lambda reading, key, scale: reading.time_with_timezone, value_fn=lambda reading, key, scale: reading.time,
), ),
) )
@ -212,7 +212,7 @@ class DiscovergySensor(CoordinatorEntity[DiscovergyUpdateCoordinator], SensorEnt
self._attr_device_info = DeviceInfo( self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, meter.meter_id)}, identifiers={(DOMAIN, meter.meter_id)},
name=f"{meter.measurement_type.capitalize()} {meter.location.street} {meter.location.street_number}", name=f"{meter.measurement_type.capitalize()} {meter.location.street} {meter.location.street_number}",
model=meter.type, model=meter.meter_type,
manufacturer=MANUFACTURER, manufacturer=MANUFACTURER,
serial_number=meter.full_serial_number, serial_number=meter.full_serial_number,
) )

View File

@ -1767,7 +1767,7 @@ pydelijn==1.1.0
pydexcom==0.2.3 pydexcom==0.2.3
# homeassistant.components.discovergy # homeassistant.components.discovergy
pydiscovergy==2.0.5 pydiscovergy==3.0.0
# homeassistant.components.doods # homeassistant.components.doods
pydoods==1.0.2 pydoods==1.0.2

View File

@ -1369,7 +1369,7 @@ pydeconz==114
pydexcom==0.2.3 pydexcom==0.2.3
# homeassistant.components.discovergy # homeassistant.components.discovergy
pydiscovergy==2.0.5 pydiscovergy==3.0.0
# homeassistant.components.hydrawise # homeassistant.components.hydrawise
pydrawise==2024.2.0 pydrawise==2024.2.0

View File

@ -8,7 +8,7 @@ GET_METERS = [
meter_id="f8d610b7a8cc4e73939fa33b990ded54", meter_id="f8d610b7a8cc4e73939fa33b990ded54",
serial_number="abc123", serial_number="abc123",
full_serial_number="abc123", full_serial_number="abc123",
type="TST", meter_type="TST",
measurement_type="ELECTRICITY", measurement_type="ELECTRICITY",
load_profile_type="SLP", load_profile_type="SLP",
location=Location( location=Location(
@ -34,7 +34,7 @@ GET_METERS = [
meter_id="d81a652fe0824f9a9d336016587d3b9d", meter_id="d81a652fe0824f9a9d336016587d3b9d",
serial_number="def456", serial_number="def456",
full_serial_number="def456", full_serial_number="def456",
type="PIP", meter_type="PIP",
measurement_type="GAS", measurement_type="GAS",
load_profile_type="SLP", load_profile_type="SLP",
location=Location( location=Location(

View File

@ -19,8 +19,8 @@
'location': '**REDACTED**', 'location': '**REDACTED**',
'measurement_type': 'ELECTRICITY', 'measurement_type': 'ELECTRICITY',
'meter_id': 'f8d610b7a8cc4e73939fa33b990ded54', 'meter_id': 'f8d610b7a8cc4e73939fa33b990ded54',
'meter_type': 'TST',
'serial_number': '**REDACTED**', 'serial_number': '**REDACTED**',
'type': 'TST',
}), }),
dict({ dict({
'additional': dict({ 'additional': dict({
@ -39,8 +39,8 @@
'location': '**REDACTED**', 'location': '**REDACTED**',
'measurement_type': 'GAS', 'measurement_type': 'GAS',
'meter_id': 'd81a652fe0824f9a9d336016587d3b9d', 'meter_id': 'd81a652fe0824f9a9d336016587d3b9d',
'meter_type': 'PIP',
'serial_number': '**REDACTED**', 'serial_number': '**REDACTED**',
'type': 'PIP',
}), }),
]), ]),
'readings': dict({ 'readings': dict({