From cf7519e7db7ee6beec89c542f03848e82abd2a16 Mon Sep 17 00:00:00 2001 From: Jules Dejaeghere Date: Thu, 5 Dec 2024 23:12:20 +0100 Subject: [PATCH] Update requirements --- requirements.txt | 4 ++-- requirements_tests.txt | 4 ++-- tests/test_sensors.py | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index c247417..d2eef31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -aiohttp==3.10.10 +aiohttp==3.11.9 async-timeout==4.0.3 -homeassistant==2024.11.1 +homeassistant==2024.12.0 voluptuous==0.15.2 svgwrite==1.4.3 aiofile==3.9.0 \ No newline at end of file diff --git a/requirements_tests.txt b/requirements_tests.txt index 56e4d83..5919641 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,5 +1,5 @@ -homeassistant==2024.11.1 -pytest_homeassistant_custom_component==0.13.182 +homeassistant==2024.12.0 +pytest_homeassistant_custom_component==0.13.190 pytest freezegun isort \ No newline at end of file diff --git a/tests/test_sensors.py b/tests/test_sensors.py index 1c4d2d4..cadc2b7 100644 --- a/tests/test_sensors.py +++ b/tests/test_sensors.py @@ -78,6 +78,11 @@ async def test_next_warning_when_data_available( warning = IrmKmiNextWarning(coordinator, mock_config_entry) warning.hass = hass + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + warning._attr_translation_key = None + assert warning.state == "2024-01-12T06:00:00+00:00" assert len(warning.extra_state_attributes['next_warnings']) == 2 @@ -98,6 +103,11 @@ async def test_next_warning_none_when_only_active_warnings( warning = IrmKmiNextWarning(coordinator, mock_config_entry) warning.hass = hass + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + warning._attr_translation_key = None + assert warning.state is None assert len(warning.extra_state_attributes['next_warnings']) == 0 @@ -115,6 +125,11 @@ async def test_next_warning_none_when_no_warnings( warning = IrmKmiNextWarning(coordinator, mock_config_entry) warning.hass = hass + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + warning._attr_translation_key = None + assert warning.state is None assert len(warning.extra_state_attributes['next_warnings']) == 0 @@ -124,6 +139,11 @@ async def test_next_warning_none_when_no_warnings( warning = IrmKmiNextWarning(coordinator, mock_config_entry) warning.hass = hass + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + warning._attr_translation_key = None + assert warning.state is None assert len(warning.extra_state_attributes['next_warnings']) == 0 @@ -146,6 +166,12 @@ async def test_next_sunrise_sunset( sunset = IrmKmiNextSunMove(coordinator, mock_config_entry, 'sunset') sunrise = IrmKmiNextSunMove(coordinator, mock_config_entry, 'sunrise') + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + sunrise._attr_translation_key = None + sunset._attr_translation_key = None + assert datetime.fromisoformat(sunrise.state) == datetime.fromisoformat('2023-12-27T08:44:00+01:00') assert datetime.fromisoformat(sunset.state) == datetime.fromisoformat('2023-12-27T16:43:00+01:00') @@ -166,5 +192,11 @@ async def test_next_sunrise_sunset_bis( sunset = IrmKmiNextSunMove(coordinator, mock_config_entry, 'sunset') sunrise = IrmKmiNextSunMove(coordinator, mock_config_entry, 'sunrise') + # This somehow fixes the following error that popped since 2024.12.0 + # ValueError: Entity cannot have a translation key for + # unit of measurement before being added to the entity platform + sunrise._attr_translation_key = None + sunset._attr_translation_key = None + assert datetime.fromisoformat(sunrise.state) == datetime.fromisoformat('2023-12-27T08:44:00+01:00') assert datetime.fromisoformat(sunset.state) == datetime.fromisoformat('2023-12-26T16:42:00+01:00')