Use dataclass for DhcpServiceInfo (#60136)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-11-23 13:35:53 +01:00 committed by GitHub
parent e673d9dbd0
commit 560546f65e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 89 additions and 23 deletions

View file

@ -51,7 +51,10 @@ class MissingIntegrationFrame(HomeAssistantError):
def report(
what: str, exclude_integrations: set | None = None, error_if_core: bool = True
what: str,
exclude_integrations: set | None = None,
error_if_core: bool = True,
level: int = logging.WARNING,
) -> None:
"""Report incorrect usage.
@ -68,11 +71,13 @@ def report(
_LOGGER.warning(msg, stack_info=True)
return
report_integration(what, integration_frame)
report_integration(what, integration_frame, level)
def report_integration(
what: str, integration_frame: tuple[FrameSummary, str, str]
what: str,
integration_frame: tuple[FrameSummary, str, str],
level: int = logging.WARNING,
) -> None:
"""Report incorrect usage in an integration.
@ -86,7 +91,8 @@ def report_integration(
else:
extra = ""
_LOGGER.warning(
_LOGGER.log(
level,
"Detected integration that %s. "
"Please report issue%s for %s using this method at %s, line %s: %s",
what,