From 886f314a2cd70bbcdb6235c3e88158b128fe662f Mon Sep 17 00:00:00 2001 From: Artem Sorokin Date: Mon, 8 Apr 2024 10:21:01 +0300 Subject: [PATCH] CI: Add testing against HA 2024.4 --- .github/workflows/ci.yml | 2 ++ custom_components/yandex_smart_home/config_flow.py | 3 ++- tests/requirements_2024.4.txt | 5 +++++ tests/test_handlers.py | 5 ++--- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tests/requirements_2024.4.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b33f2b..d4b41e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: python-version: '3.11' - ha-version: '2024.2' python-version: '3.12' + - ha-version: '2024.4' + python-version: '3.12' latest: true steps: - uses: actions/checkout@v3 diff --git a/custom_components/yandex_smart_home/config_flow.py b/custom_components/yandex_smart_home/config_flow.py index ddef4fc..5a27cde 100644 --- a/custom_components/yandex_smart_home/config_flow.py +++ b/custom_components/yandex_smart_home/config_flow.py @@ -1,4 +1,5 @@ """Config flow for the Yandex Smart Home integration.""" + from __future__ import annotations import logging @@ -185,7 +186,7 @@ def __init__(self) -> None: self._data: ConfigType = {const.CONF_DEVICES_DISCOVERED: False} self._async_step_filter_settings_done = self.async_step_connection_type - async def async_step_user(self, user_input: ConfigType | None = None) -> FlowResult: + async def async_step_user(self, user_input: ConfigType | None = None) -> FlowResult: # type: ignore """Handle a flow initialized by the user.""" if self._async_current_entries(): return self.async_abort(reason="single_instance_allowed") diff --git a/tests/requirements_2024.4.txt b/tests/requirements_2024.4.txt new file mode 100644 index 0000000..370a49b --- /dev/null +++ b/tests/requirements_2024.4.txt @@ -0,0 +1,5 @@ +pytest-homeassistant-custom-component==0.13.112 +aiohttp-cors==0.7.0 +home_assistant_intents==2024.2.2 +hassil==1.5.1 +voluptuous-stubs==0.1.1 diff --git a/tests/test_handlers.py b/tests/test_handlers.py index ff7eb3d..c834d5e 100644 --- a/tests/test_handlers.py +++ b/tests/test_handlers.py @@ -490,9 +490,8 @@ async def set_instance_state(self, context: Context, state: ToggleCapabilityInst ] } - assert ( - caplog.records[-2].message == "Error code 'switch.test: WAT?' is invalid for switch.test (INTERNAL_ERROR)" - ) + records = list(filter(lambda x: x.module == "handlers", caplog.records)) + assert records[0].message == "Error code 'switch.test: WAT?' is invalid for switch.test (INTERNAL_ERROR)" hass.states.async_set("sensor.foo", "bar") payload = json.dumps(