Move EVENT_LOGGING_CHANGED to constants (#100974)
* Move EVENT_LOGGING_CHANGED to constants * fix test * remove logger as dependency for bluetooth and fix test
This commit is contained in:
parent
009349acf0
commit
067b94899f
10 changed files with 9 additions and 10 deletions
|
@ -18,7 +18,7 @@ from bluetooth_adapters import (
|
|||
)
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.logger import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.const import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.core import (
|
||||
CALLBACK_TYPE,
|
||||
Event,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "Bluetooth",
|
||||
"codeowners": ["@bdraco"],
|
||||
"config_flow": true,
|
||||
"dependencies": ["logger", "usb"],
|
||||
"dependencies": ["usb"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/bluetooth",
|
||||
"iot_class": "local_push",
|
||||
"loggers": [
|
||||
|
|
|
@ -6,6 +6,7 @@ import re
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import EVENT_LOGGING_CHANGED # noqa: F401
|
||||
from homeassistant.core import HomeAssistant, ServiceCall, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
@ -14,7 +15,6 @@ from . import websocket_api
|
|||
from .const import (
|
||||
ATTR_LEVEL,
|
||||
DOMAIN,
|
||||
EVENT_LOGGING_CHANGED, # noqa: F401
|
||||
LOGGER_DEFAULT,
|
||||
LOGGER_FILTERS,
|
||||
LOGGER_LOGS,
|
||||
|
|
|
@ -35,8 +35,6 @@ LOGGER_FILTERS = "filters"
|
|||
|
||||
ATTR_LEVEL = "level"
|
||||
|
||||
EVENT_LOGGING_CHANGED = "logging_changed"
|
||||
|
||||
STORAGE_KEY = "core.logger"
|
||||
STORAGE_LOG_KEY = "logs"
|
||||
STORAGE_VERSION = 1
|
||||
|
|
|
@ -9,6 +9,7 @@ from enum import StrEnum
|
|||
import logging
|
||||
from typing import Any, cast
|
||||
|
||||
from homeassistant.const import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.storage import Store
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
@ -16,7 +17,6 @@ from homeassistant.loader import IntegrationNotFound, async_get_integration
|
|||
|
||||
from .const import (
|
||||
DOMAIN,
|
||||
EVENT_LOGGING_CHANGED,
|
||||
LOGGER_DEFAULT,
|
||||
LOGGER_LOGS,
|
||||
LOGSEVERITY,
|
||||
|
|
|
@ -29,8 +29,7 @@ from typing import TYPE_CHECKING, Any, Final, cast
|
|||
import voluptuous as vol
|
||||
from yarl import URL
|
||||
|
||||
from homeassistant.components.logger import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, EVENT_LOGGING_CHANGED
|
||||
from homeassistant.core import Event, HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"domain": "stream",
|
||||
"name": "Stream",
|
||||
"codeowners": ["@hunterjm", "@uvjustin", "@allenporter"],
|
||||
"dependencies": ["http", "logger"],
|
||||
"dependencies": ["http"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/stream",
|
||||
"integration_type": "system",
|
||||
"iot_class": "local_push",
|
||||
|
|
|
@ -288,6 +288,7 @@ EVENT_HOMEASSISTANT_STARTED: Final = "homeassistant_started"
|
|||
EVENT_HOMEASSISTANT_STOP: Final = "homeassistant_stop"
|
||||
EVENT_HOMEASSISTANT_FINAL_WRITE: Final = "homeassistant_final_write"
|
||||
EVENT_LOGBOOK_ENTRY: Final = "logbook_entry"
|
||||
EVENT_LOGGING_CHANGED: Final = "logging_changed"
|
||||
EVENT_SERVICE_REGISTERED: Final = "service_registered"
|
||||
EVENT_SERVICE_REMOVED: Final = "service_removed"
|
||||
EVENT_STATE_CHANGED: Final = "state_changed"
|
||||
|
|
|
@ -1011,6 +1011,7 @@ async def test_debug_logging(
|
|||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Test debug logging."""
|
||||
assert await async_setup_component(hass, "logger", {"logger": {}})
|
||||
await hass.services.async_call(
|
||||
"logger",
|
||||
"set_level",
|
||||
|
|
|
@ -4,8 +4,8 @@ import logging
|
|||
import av
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.logger import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.components.stream import __name__ as stream_name
|
||||
from homeassistant.const import EVENT_LOGGING_CHANGED
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue