Fix call on root logger (LOG015) (#140556)

This commit is contained in:
Marc Mueller
2025-03-13 23:02:26 +01:00
committed by GitHub
parent cdead8661d
commit b48ab77a38
4 changed files with 15 additions and 7 deletions

View File

@ -11,6 +11,8 @@ from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2FlowHan
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
class OAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
"""Config flow to handle Minut Point OAuth2 authentication."""
@ -56,7 +58,7 @@ class OAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
if reauth_entry.unique_id is not None:
self._abort_if_unique_id_mismatch(reason="wrong_account")
logging.debug("user_id: %s", user_id)
_LOGGER.debug("user_id: %s", user_id)
return self.async_update_reload_and_abort(
reauth_entry, data_updates=data, unique_id=user_id
)

View File

@ -12,6 +12,8 @@ from homeassistant.helpers import config_validation as cv
from .const import DEFAULT_PORT, DOMAIN, LEGACY_PORT
_LOGGER = logging.getLogger(__name__)
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_HOST): cv.string,
@ -21,7 +23,7 @@ DATA_SCHEMA = vol.Schema(
async def async_find_box_port(host: str) -> int:
"""Find port box uses for communication."""
logging.debug("Attempting to find port to connect to %s on", host)
_LOGGER.debug("Attempting to find port to connect to %s on", host)
remote = RemoteControl(host, DEFAULT_PORT)
try:
await remote.check_connectable()
@ -46,12 +48,12 @@ class SkyRemoteConfigFlow(ConfigFlow, domain=DOMAIN):
errors: dict[str, str] = {}
if user_input is not None:
logging.debug("user_input: %s", user_input)
_LOGGER.debug("user_input: %s", user_input)
self._async_abort_entries_match(user_input)
try:
port = await async_find_box_port(user_input[CONF_HOST])
except SkyBoxConnectionError:
logging.exception("while finding port of skybox")
_LOGGER.exception("While finding port of skybox")
errors["base"] = "cannot_connect"
else:
return self.async_create_entry(

View File

@ -27,6 +27,8 @@ from homeassistant.components.stream.worker import StreamState
from .common import generate_h264_video, stream_teardown
_LOGGER = logging.getLogger(__name__)
TEST_TIMEOUT = 7.0 # Lower than 9s home assistant timeout
@ -44,7 +46,7 @@ class WorkerSync:
def resume(self):
"""Allow the worker thread to finalize the stream."""
logging.debug("waking blocked worker")
_LOGGER.debug("waking blocked worker")
self._event.set()
def blocking_discontinuity(self, stream_state: StreamState):
@ -52,7 +54,7 @@ class WorkerSync:
# Worker is ending the stream, which clears all output buffers.
# Block the worker thread until the test has a chance to verify
# the segments under test.
logging.debug("blocking worker")
_LOGGER.debug("blocking worker")
if self._event:
self._event.wait()

View File

@ -56,6 +56,8 @@ from .test_ll_hls import TEST_PART_DURATION
from tests.components.camera.common import EMPTY_8_6_JPEG, mock_turbo_jpeg
_LOGGER = logging.getLogger(__name__)
STREAM_SOURCE = "some-stream-source"
# Formats here are arbitrary, not exercised by tests
AUDIO_STREAM_FORMAT = "mp3"
@ -229,7 +231,7 @@ class FakePyAvBuffer:
return
def mux(self, packet):
logging.debug("Muxed packet: %s", packet)
_LOGGER.debug("Muxed packet: %s", packet)
self.capture_packets.append(packet)
def __str__(self) -> str: