From 24afbf3ae4c64df87128cc7dfc62241583cc89a1 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 15 Oct 2023 23:03:45 +0200 Subject: [PATCH] Address late Withings review (#102075) --- homeassistant/components/withings/diagnostics.py | 2 +- homeassistant/components/withings/sensor.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/withings/diagnostics.py b/homeassistant/components/withings/diagnostics.py index 2424452d0f5..efa0421f205 100644 --- a/homeassistant/components/withings/diagnostics.py +++ b/homeassistant/components/withings/diagnostics.py @@ -40,6 +40,6 @@ async def async_get_config_entry_diagnostics( "has_valid_external_webhook_url": has_valid_external_webhook_url, "has_cloudhooks": has_cloudhooks, "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, } diff --git a/homeassistant/components/withings/sensor.py b/homeassistant/components/withings/sensor.py index e5096701b48..d09ae550d0f 100644 --- a/homeassistant/components/withings/sensor.py +++ b/homeassistant/components/withings/sensor.py @@ -406,7 +406,7 @@ async def async_setup_entry( DOMAIN ][entry.entry_id][MEASUREMENT_COORDINATOR] - current_measurement_types = set(measurement_coordinator.data.keys()) + current_measurement_types = set(measurement_coordinator.data) entities: list[SensorEntity] = [] entities.extend( @@ -419,7 +419,7 @@ async def async_setup_entry( def _async_measurement_listener() -> None: """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 if new_measurement_types: current_measurement_types.update(new_measurement_types)