From 7d0e314c356e7663d77c6941e46844580218d835 Mon Sep 17 00:00:00 2001 From: Duco Sebel <74970928+DCSBL@users.noreply.github.com> Date: Wed, 29 Jan 2025 01:00:46 +0100 Subject: [PATCH] Bumb python-homewizard-energy to 8.3.0 (#136765) --- homeassistant/components/homewizard/manifest.json | 2 +- homeassistant/components/homewizard/sensor.py | 11 +++++++++-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- .../homewizard/snapshots/test_diagnostics.ambr | 9 +++++++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/homewizard/manifest.json b/homeassistant/components/homewizard/manifest.json index b1a19134752..957ed912b7d 100644 --- a/homeassistant/components/homewizard/manifest.json +++ b/homeassistant/components/homewizard/manifest.json @@ -12,6 +12,6 @@ "iot_class": "local_polling", "loggers": ["homewizard_energy"], "quality_scale": "platinum", - "requirements": ["python-homewizard-energy==v8.2.0"], + "requirements": ["python-homewizard-energy==v8.3.0"], "zeroconf": ["_hwenergy._tcp.local.", "_homewizard._tcp.local."] } diff --git a/homeassistant/components/homewizard/sensor.py b/homeassistant/components/homewizard/sensor.py index b6227a03bed..02355bc6c5e 100644 --- a/homeassistant/components/homewizard/sensor.py +++ b/homeassistant/components/homewizard/sensor.py @@ -116,8 +116,15 @@ SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = ( state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, - has_fn=lambda data: data.measurement.wifi_strength is not None, - value_fn=lambda data: data.measurement.wifi_strength, + has_fn=( + lambda data: data.system is not None + and data.system.wifi_strength_pct is not None + ), + value_fn=( + lambda data: data.system.wifi_strength_pct + if data.system is not None + else None + ), ), HomeWizardSensorEntityDescription( key="total_power_import_kwh", diff --git a/requirements_all.txt b/requirements_all.txt index a366b5f2f32..b0823505444 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2388,7 +2388,7 @@ python-gitlab==1.6.0 python-homeassistant-analytics==0.8.1 # homeassistant.components.homewizard -python-homewizard-energy==v8.2.0 +python-homewizard-energy==v8.3.0 # homeassistant.components.hp_ilo python-hpilo==4.4.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a8e934d8dd2..dfd3edcba67 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1933,7 +1933,7 @@ python-fullykiosk==0.0.14 python-homeassistant-analytics==0.8.1 # homeassistant.components.homewizard -python-homewizard-energy==v8.2.0 +python-homewizard-energy==v8.3.0 # homeassistant.components.izone python-izone==1.2.9 diff --git a/tests/components/homewizard/snapshots/test_diagnostics.ambr b/tests/components/homewizard/snapshots/test_diagnostics.ambr index 192b9dbdc32..2545f674bbd 100644 --- a/tests/components/homewizard/snapshots/test_diagnostics.ambr +++ b/tests/components/homewizard/snapshots/test_diagnostics.ambr @@ -79,6 +79,7 @@ 'uptime_s': 356, 'wifi_rssi_db': -77, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 100, }), }), 'entry': dict({ @@ -169,6 +170,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 92, }), }), 'entry': dict({ @@ -259,6 +261,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 92, }), }), 'entry': dict({ @@ -385,6 +388,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 100, }), }), 'entry': dict({ @@ -479,6 +483,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 94, }), }), 'entry': dict({ @@ -573,6 +578,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 100, }), }), 'entry': dict({ @@ -663,6 +669,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 84, }), }), 'entry': dict({ @@ -753,6 +760,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 92, }), }), 'entry': dict({ @@ -843,6 +851,7 @@ 'uptime_s': None, 'wifi_rssi_db': None, 'wifi_ssid': '**REDACTED**', + 'wifi_strength_pct': 92, }), }), 'entry': dict({