From 890f0a9db52f963dd1fea6d9ed2b61e50543bd17 Mon Sep 17 00:00:00 2001 From: Jacob Berelman <630000+stickpin@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:02:06 +0100 Subject: [PATCH 1/4] fix ruff --- tests/conftest.py | 15 +++++++++------ tests/util_test.py | 9 +++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 934c8fe..62152b6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,12 +14,15 @@ def auto_enable_custom_integrations(enable_custom_integrations): @pytest.fixture def bypass_setup_fixture(): """Prevent setup.""" - with patch( - "custom_components.volkswagencarnet.async_setup", - return_value=True, - ), patch( - "custom_components.volkswagencarnet.async_setup_entry", - return_value=True, + with ( + patch( + "custom_components.volkswagencarnet.async_setup", + return_value=True, + ), + patch( + "custom_components.volkswagencarnet.async_setup_entry", + return_value=True, + ), ): yield diff --git a/tests/util_test.py b/tests/util_test.py index 2c1872f..dca7973 100644 --- a/tests/util_test.py +++ b/tests/util_test.py @@ -42,10 +42,11 @@ async def test_get_coordinator(hass: HomeAssistant): } # We want to skip the actual setup flow here - with patch.object( - homeassistant.config_entries.ConfigEntries, "async_setup" - ) as flow, patch.object( - homeassistant.config_entries.ConfigEntries, "_async_schedule_save" + with ( + patch.object(homeassistant.config_entries.ConfigEntries, "async_setup") as flow, + patch.object( + homeassistant.config_entries.ConfigEntries, "_async_schedule_save" + ), ): f: Future = Future() f.set_result(True) From 2ac0d5caa7556e6765d5246bee05f4e250a4f780 Mon Sep 17 00:00:00 2001 From: Jacob Berelman <630000+stickpin@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:03:39 +0100 Subject: [PATCH 2/4] more ruff fixes --- tests/timer_services_test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/timer_services_test.py b/tests/timer_services_test.py index fe68654..a890e69 100644 --- a/tests/timer_services_test.py +++ b/tests/timer_services_test.py @@ -76,9 +76,12 @@ async def test_call_service(conn: MagicMock, hass: HomeAssistant): target_temp = 24.5 data = {"device_id": e.entry_id, "target_temperature": target_temp} - with patch( - "custom_components.volkswagencarnet.services.get_coordinator_by_device_id" - ) as m, patch.object(c.connection, "getTimers") as get_timers: + with ( + patch( + "custom_components.volkswagencarnet.services.get_coordinator_by_device_id" + ) as m, + patch.object(c.connection, "getTimers") as get_timers, + ): m.return_value = c timer_profiles = [ TimerProfile( From 445cdfd7748c1277cda7c11400642418dbfb3389 Mon Sep 17 00:00:00 2001 From: Jacob Berelman <630000+stickpin@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:09:07 +0100 Subject: [PATCH 3/4] fix trailing space --- custom_components/volkswagencarnet/strings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/volkswagencarnet/strings.json b/custom_components/volkswagencarnet/strings.json index 8bd19a2..024893e 100644 --- a/custom_components/volkswagencarnet/strings.json +++ b/custom_components/volkswagencarnet/strings.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Re-authenticate with your Volkswagen Connect account. Make sure to accept any new EULA in the Volkswagen Connect portal (https://www.myvolkswagen.net/) before proceeding. ", + "description": "Re-authenticate with your Volkswagen Connect account. Make sure to accept any new EULA in the Volkswagen Connect portal (https://www.myvolkswagen.net/) before proceeding.", "email": "[%key:common::config_flow::data::email%]", "password": "[%key:common::config_flow::data::password%]" } From df4b5bc973b7cb67efed28d7cd1571cc1035aea9 Mon Sep 17 00:00:00 2001 From: Jacob Berelman <630000+stickpin@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:11:11 +0100 Subject: [PATCH 4/4] more trailing spaces fixes --- custom_components/volkswagencarnet/translations/da.json | 2 +- custom_components/volkswagencarnet/translations/en.json | 2 +- custom_components/volkswagencarnet/translations/fi.json | 2 +- custom_components/volkswagencarnet/translations/pt-BR.json | 2 +- custom_components/volkswagencarnet/translations/ru.json | 2 +- custom_components/volkswagencarnet/translations/sl.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/volkswagencarnet/translations/da.json b/custom_components/volkswagencarnet/translations/da.json index 7033267..bae9e86 100644 --- a/custom_components/volkswagencarnet/translations/da.json +++ b/custom_components/volkswagencarnet/translations/da.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Log ind igen med din Volkswagen Connect konto. Vær sikker på at acceptere nye EULA i Volkswagen Connect portalen (https://www.myvolkswagen.net/) før du fortsætter. ", + "description": "Log ind igen med din Volkswagen Connect konto. Vær sikker på at acceptere nye EULA i Volkswagen Connect portalen (https://www.myvolkswagen.net/) før du fortsætter.", "email": "Email", "password": "Adgangskode" } diff --git a/custom_components/volkswagencarnet/translations/en.json b/custom_components/volkswagencarnet/translations/en.json index 8791e1c..41fd9c1 100644 --- a/custom_components/volkswagencarnet/translations/en.json +++ b/custom_components/volkswagencarnet/translations/en.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Re-authenticate with your Volkswagen Connect account. Make sure to accept any new EULA in the Volkswagen Connect portal (https://www.myvolkswagen.net/) before proceeding. ", + "description": "Re-authenticate with your Volkswagen Connect account. Make sure to accept any new EULA in the Volkswagen Connect portal (https://www.myvolkswagen.net/) before proceeding.", "email": "Email", "password": "Password" } diff --git a/custom_components/volkswagencarnet/translations/fi.json b/custom_components/volkswagencarnet/translations/fi.json index 1551280..f03ae7f 100644 --- a/custom_components/volkswagencarnet/translations/fi.json +++ b/custom_components/volkswagencarnet/translations/fi.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Kirjausu uudelleen Volkswagen Connectiin. Varmista että olet hyväksynyt mahdolliset uudet Volkswagen Connect portaalin käyttöehdot (https://www.myvolkswagen.net/) ensin. ", + "description": "Kirjausu uudelleen Volkswagen Connectiin. Varmista että olet hyväksynyt mahdolliset uudet Volkswagen Connect portaalin käyttöehdot (https://www.myvolkswagen.net/) ensin.", "username": "Sähköposti", "password": "Salasana" } diff --git a/custom_components/volkswagencarnet/translations/pt-BR.json b/custom_components/volkswagencarnet/translations/pt-BR.json index 5c666b2..2aec260 100644 --- a/custom_components/volkswagencarnet/translations/pt-BR.json +++ b/custom_components/volkswagencarnet/translations/pt-BR.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Re-autentique com sua conta Volkswagen Connect. Certifique-se de aceitar qualquer novo EULA no portal Volkswagen Connect (https://www.myvolkswagen.net/) antes de continuar. ", + "description": "Re-autentique com sua conta Volkswagen Connect. Certifique-se de aceitar qualquer novo EULA no portal Volkswagen Connect (https://www.myvolkswagen.net/) antes de continuar.", "username": "Email", "password": "Senha" } diff --git a/custom_components/volkswagencarnet/translations/ru.json b/custom_components/volkswagencarnet/translations/ru.json index 17297c5..a711345 100644 --- a/custom_components/volkswagencarnet/translations/ru.json +++ b/custom_components/volkswagencarnet/translations/ru.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Повторно войдите в свою учетную запись Volkswagen Connect. Перед продолжением обязательно примите новое лицензионное соглашение с конечным пользователем на портале Volkswagen Connect (https://www.myvolkswagen.net/). ", + "description": "Повторно войдите в свою учетную запись Volkswagen Connect. Перед продолжением обязательно примите новое лицензионное соглашение с конечным пользователем на портале Volkswagen Connect (https://www.myvolkswagen.net/).", "email": "Email", "password": "Password" } diff --git a/custom_components/volkswagencarnet/translations/sl.json b/custom_components/volkswagencarnet/translations/sl.json index fe12e84..a235a2b 100644 --- a/custom_components/volkswagencarnet/translations/sl.json +++ b/custom_components/volkswagencarnet/translations/sl.json @@ -32,7 +32,7 @@ }, "reauth_confirm": { "data": { - "description": "Ponovno se prijavite v svoj Volkswagen Connect račun. Poskrbite, da sprejmete morebitno novo licenco EULA v portalu Volkswagen Connect (https://www.myvolkswagen.net/), preden nadaljujete. ", + "description": "Ponovno se prijavite v svoj Volkswagen Connect račun. Poskrbite, da sprejmete morebitno novo licenco EULA v portalu Volkswagen Connect (https://www.myvolkswagen.net/), preden nadaljujete.", "email": "E-pošta", "password": "Geslo" }