mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 10:48:01 +02:00
Fix call on root logger (LOG015) (#140556)
This commit is contained in:
@ -11,6 +11,8 @@ from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2FlowHan
|
|||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class OAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
class OAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
||||||
"""Config flow to handle Minut Point OAuth2 authentication."""
|
"""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:
|
if reauth_entry.unique_id is not None:
|
||||||
self._abort_if_unique_id_mismatch(reason="wrong_account")
|
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(
|
return self.async_update_reload_and_abort(
|
||||||
reauth_entry, data_updates=data, unique_id=user_id
|
reauth_entry, data_updates=data, unique_id=user_id
|
||||||
)
|
)
|
||||||
|
@ -12,6 +12,8 @@ from homeassistant.helpers import config_validation as cv
|
|||||||
|
|
||||||
from .const import DEFAULT_PORT, DOMAIN, LEGACY_PORT
|
from .const import DEFAULT_PORT, DOMAIN, LEGACY_PORT
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DATA_SCHEMA = vol.Schema(
|
DATA_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_HOST): cv.string,
|
vol.Required(CONF_HOST): cv.string,
|
||||||
@ -21,7 +23,7 @@ DATA_SCHEMA = vol.Schema(
|
|||||||
|
|
||||||
async def async_find_box_port(host: str) -> int:
|
async def async_find_box_port(host: str) -> int:
|
||||||
"""Find port box uses for communication."""
|
"""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)
|
remote = RemoteControl(host, DEFAULT_PORT)
|
||||||
try:
|
try:
|
||||||
await remote.check_connectable()
|
await remote.check_connectable()
|
||||||
@ -46,12 +48,12 @@ class SkyRemoteConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
errors: dict[str, str] = {}
|
errors: dict[str, str] = {}
|
||||||
if user_input is not None:
|
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)
|
self._async_abort_entries_match(user_input)
|
||||||
try:
|
try:
|
||||||
port = await async_find_box_port(user_input[CONF_HOST])
|
port = await async_find_box_port(user_input[CONF_HOST])
|
||||||
except SkyBoxConnectionError:
|
except SkyBoxConnectionError:
|
||||||
logging.exception("while finding port of skybox")
|
_LOGGER.exception("While finding port of skybox")
|
||||||
errors["base"] = "cannot_connect"
|
errors["base"] = "cannot_connect"
|
||||||
else:
|
else:
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
|
@ -27,6 +27,8 @@ from homeassistant.components.stream.worker import StreamState
|
|||||||
|
|
||||||
from .common import generate_h264_video, stream_teardown
|
from .common import generate_h264_video, stream_teardown
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
TEST_TIMEOUT = 7.0 # Lower than 9s home assistant timeout
|
TEST_TIMEOUT = 7.0 # Lower than 9s home assistant timeout
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ class WorkerSync:
|
|||||||
|
|
||||||
def resume(self):
|
def resume(self):
|
||||||
"""Allow the worker thread to finalize the stream."""
|
"""Allow the worker thread to finalize the stream."""
|
||||||
logging.debug("waking blocked worker")
|
_LOGGER.debug("waking blocked worker")
|
||||||
self._event.set()
|
self._event.set()
|
||||||
|
|
||||||
def blocking_discontinuity(self, stream_state: StreamState):
|
def blocking_discontinuity(self, stream_state: StreamState):
|
||||||
@ -52,7 +54,7 @@ class WorkerSync:
|
|||||||
# Worker is ending the stream, which clears all output buffers.
|
# Worker is ending the stream, which clears all output buffers.
|
||||||
# Block the worker thread until the test has a chance to verify
|
# Block the worker thread until the test has a chance to verify
|
||||||
# the segments under test.
|
# the segments under test.
|
||||||
logging.debug("blocking worker")
|
_LOGGER.debug("blocking worker")
|
||||||
if self._event:
|
if self._event:
|
||||||
self._event.wait()
|
self._event.wait()
|
||||||
|
|
||||||
|
@ -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
|
from tests.components.camera.common import EMPTY_8_6_JPEG, mock_turbo_jpeg
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
STREAM_SOURCE = "some-stream-source"
|
STREAM_SOURCE = "some-stream-source"
|
||||||
# Formats here are arbitrary, not exercised by tests
|
# Formats here are arbitrary, not exercised by tests
|
||||||
AUDIO_STREAM_FORMAT = "mp3"
|
AUDIO_STREAM_FORMAT = "mp3"
|
||||||
@ -229,7 +231,7 @@ class FakePyAvBuffer:
|
|||||||
return
|
return
|
||||||
|
|
||||||
def mux(self, packet):
|
def mux(self, packet):
|
||||||
logging.debug("Muxed packet: %s", packet)
|
_LOGGER.debug("Muxed packet: %s", packet)
|
||||||
self.capture_packets.append(packet)
|
self.capture_packets.append(packet)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
|
Reference in New Issue
Block a user