diff --git a/hass_nabucasa/remote.py b/hass_nabucasa/remote.py index 2c5ab82bb..46fb9d6d9 100644 --- a/hass_nabucasa/remote.py +++ b/hass_nabucasa/remote.py @@ -291,7 +291,7 @@ async def load_backend(self) -> bool: _LOGGER.debug("Waiting for aiohttp runner to come available") # aiohttp_runner comes available when Home Assistant has started. - while self.cloud.client.aiohttp_runner is None: + while self.cloud.client.aiohttp_runner is None: # noqa: ASYNC110 await asyncio.sleep(1) try: diff --git a/hass_nabucasa/voice.py b/hass_nabucasa/voice.py index e71c6712a..bc1c14aec 100644 --- a/hass_nabucasa/voice.py +++ b/hass_nabucasa/voice.py @@ -7,7 +7,7 @@ from enum import Enum import logging from typing import TYPE_CHECKING -from xml.etree import ElementTree +from xml.etree import ElementTree as ET from aiohttp.hdrs import ACCEPT, AUTHORIZATION, CONTENT_TYPE, USER_AGENT import attr @@ -1323,9 +1323,9 @@ async def process_tts( await self._update_token() # SSML - xml_body = ElementTree.Element("speak", version="1.0") + xml_body = ET.Element("speak", version="1.0") xml_body.set("{http://www.w3.org/XML/1998/namespace}lang", language) - voice_el = ElementTree.SubElement(xml_body, "voice") + voice_el = ET.SubElement(xml_body, "voice") voice_el.set("{http://www.w3.org/XML/1998/namespace}lang", language) voice_el.set( "name", @@ -1350,7 +1350,7 @@ async def process_tts( "X-Microsoft-OutputFormat": output_header, USER_AGENT: self.cloud.client.client_name, }, - data=ElementTree.tostring(xml_body), + data=ET.tostring(xml_body), ) as resp: if resp.status == 429 and not force_token_renewal: # By checking the force_token_renewal argument, we limit retries to 1. diff --git a/pyproject.toml b/pyproject.toml index 614a79b50..76af61128 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ test = [ "pytest-aiohttp==1.0.5", "pytest-timeout==2.3.1", "pytest==8.3.3", - "ruff==0.5.5", + "ruff==0.7.2", "types_atomicwrites==1.4.5.1", "types_pyOpenSSL==24.1.0.20240722", "xmltodict==0.14.2", diff --git a/tests/ruff.toml b/tests/ruff.toml index 74b8cc843..ed29ca986 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -11,6 +11,7 @@ ignore = [ "ANN003", "ANN201", "ANN202", + "ASYNC109", "ASYNC230", "PT004", "PT006",