Address late Withings review (#102075)

This commit is contained in:
Joost Lekkerkerker 2023-10-15 23:03:45 +02:00 committed by GitHub
parent b4295e909c
commit 24afbf3ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -40,6 +40,6 @@ async def async_get_config_entry_diagnostics(
"has_valid_external_webhook_url": has_valid_external_webhook_url, "has_valid_external_webhook_url": has_valid_external_webhook_url,
"has_cloudhooks": has_cloudhooks, "has_cloudhooks": has_cloudhooks,
"webhooks_connected": measurement_coordinator.webhooks_connected, "webhooks_connected": measurement_coordinator.webhooks_connected,
"received_measurements": list(measurement_coordinator.data.keys()), "received_measurements": list(measurement_coordinator.data),
"received_sleep_data": sleep_coordinator.data is not None, "received_sleep_data": sleep_coordinator.data is not None,
} }

View file

@ -406,7 +406,7 @@ async def async_setup_entry(
DOMAIN DOMAIN
][entry.entry_id][MEASUREMENT_COORDINATOR] ][entry.entry_id][MEASUREMENT_COORDINATOR]
current_measurement_types = set(measurement_coordinator.data.keys()) current_measurement_types = set(measurement_coordinator.data)
entities: list[SensorEntity] = [] entities: list[SensorEntity] = []
entities.extend( entities.extend(
@ -419,7 +419,7 @@ async def async_setup_entry(
def _async_measurement_listener() -> None: def _async_measurement_listener() -> None:
"""Listen for new measurements and add sensors if they did not exist.""" """Listen for new measurements and add sensors if they did not exist."""
received_measurement_types = set(measurement_coordinator.data.keys()) received_measurement_types = set(measurement_coordinator.data)
new_measurement_types = received_measurement_types - current_measurement_types new_measurement_types = received_measurement_types - current_measurement_types
if new_measurement_types: if new_measurement_types:
current_measurement_types.update(new_measurement_types) current_measurement_types.update(new_measurement_types)