mirror of
https://github.com/home-assistant/core.git
synced 2026-02-15 07:36:16 +00:00
Remove more components from _IGNORE_ROOT_IMPORT in pylint plugin (#154622)
This commit is contained in:
@@ -74,7 +74,10 @@ from .const import (
|
||||
StreamType,
|
||||
)
|
||||
from .helper import get_camera_from_entity_id
|
||||
from .img_util import scale_jpeg_camera_image
|
||||
from .img_util import (
|
||||
TurboJPEGSingleton, # noqa: F401
|
||||
scale_jpeg_camera_image,
|
||||
)
|
||||
from .prefs import (
|
||||
CameraPreferences,
|
||||
DynamicStreamSettings, # noqa: F401
|
||||
|
||||
@@ -19,7 +19,7 @@ from homeassistant.components.alexa import (
|
||||
errors as alexa_errors,
|
||||
smart_home as alexa_smart_home,
|
||||
)
|
||||
from homeassistant.components.camera.webrtc import async_register_ice_servers
|
||||
from homeassistant.components.camera import async_register_ice_servers
|
||||
from homeassistant.components.google_assistant import smart_home as ga
|
||||
from homeassistant.const import __version__ as HA_VERSION
|
||||
from homeassistant.core import Context, HassJob, HomeAssistant, callback
|
||||
|
||||
@@ -5,7 +5,9 @@ from __future__ import annotations
|
||||
import datetime
|
||||
|
||||
from homeassistant.components.alarm_control_panel import AlarmControlPanelState
|
||||
from homeassistant.components.manual.alarm_control_panel import ManualAlarm
|
||||
from homeassistant.components.manual.alarm_control_panel import ( # pylint: disable=hass-component-root-import
|
||||
ManualAlarm,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_ARMING_TIME, CONF_DELAY_TIME, CONF_TRIGGER_TIME
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
@@ -30,8 +30,8 @@ from homeassistant.components.camera import (
|
||||
WebRTCMessage,
|
||||
WebRTCSendMessage,
|
||||
async_register_webrtc_provider,
|
||||
get_dynamic_camera_stream_settings,
|
||||
)
|
||||
from homeassistant.components.camera.prefs import get_dynamic_camera_stream_settings
|
||||
from homeassistant.components.default_config import DOMAIN as DEFAULT_CONFIG_DOMAIN
|
||||
from homeassistant.components.stream import Orientation
|
||||
from homeassistant.config_entries import SOURCE_SYSTEM, ConfigEntry
|
||||
|
||||
@@ -8,7 +8,7 @@ from pychromecast import Chromecast
|
||||
from pychromecast.const import CAST_TYPE_CHROMECAST
|
||||
|
||||
from homeassistant.components.cast import DOMAIN as CAST_DOMAIN
|
||||
from homeassistant.components.cast.home_assistant_cast import (
|
||||
from homeassistant.components.cast.home_assistant_cast import ( # pylint: disable=hass-component-root-import
|
||||
ATTR_URL_PATH,
|
||||
ATTR_VIEW_PATH,
|
||||
NO_URL_AVAILABLE_ERROR,
|
||||
|
||||
@@ -39,7 +39,9 @@ from homeassistant.components.media_player import (
|
||||
async_process_play_media_url,
|
||||
)
|
||||
from homeassistant.components.plex import PLEX_URI_SCHEME
|
||||
from homeassistant.components.plex.services import process_plex_payload
|
||||
from homeassistant.components.plex.services import ( # pylint: disable=hass-component-root-import
|
||||
process_plex_payload,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
@@ -441,9 +441,7 @@ class KeyFrameConverter:
|
||||
|
||||
# Keep import here so that we can import stream integration
|
||||
# without installing reqs
|
||||
from homeassistant.components.camera.img_util import ( # noqa: PLC0415
|
||||
TurboJPEGSingleton,
|
||||
)
|
||||
from homeassistant.components.camera import TurboJPEGSingleton # noqa: PLC0415
|
||||
|
||||
self._packet: Packet | None = None
|
||||
self._event: asyncio.Event = asyncio.Event()
|
||||
|
||||
@@ -128,8 +128,6 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
|
||||
_IGNORE_ROOT_IMPORT = (
|
||||
"automation",
|
||||
"bluetooth",
|
||||
"camera",
|
||||
"cast",
|
||||
"device_automation",
|
||||
"device_tracker",
|
||||
"ffmpeg",
|
||||
@@ -138,8 +136,6 @@ _IGNORE_ROOT_IMPORT = (
|
||||
"homeassistant",
|
||||
"homeassistant_hardware",
|
||||
"http",
|
||||
"manual",
|
||||
"plex",
|
||||
"recorder",
|
||||
"rest",
|
||||
"script",
|
||||
|
||||
@@ -21,6 +21,9 @@ import pytest
|
||||
from webrtc_models import RTCIceCandidateInit
|
||||
|
||||
from homeassistant.components.camera import (
|
||||
DATA_CAMERA_PREFS,
|
||||
CameraPreferences,
|
||||
DynamicStreamSettings,
|
||||
StreamType,
|
||||
WebRTCAnswer as HAWebRTCAnswer,
|
||||
WebRTCCandidate as HAWebRTCCandidate,
|
||||
@@ -29,11 +32,6 @@ from homeassistant.components.camera import (
|
||||
WebRTCSendMessage,
|
||||
async_get_image,
|
||||
)
|
||||
from homeassistant.components.camera.const import DATA_CAMERA_PREFS
|
||||
from homeassistant.components.camera.prefs import (
|
||||
CameraPreferences,
|
||||
DynamicStreamSettings,
|
||||
)
|
||||
from homeassistant.components.default_config import DOMAIN as DEFAULT_CONFIG_DOMAIN
|
||||
from homeassistant.components.go2rtc import HomeAssistant, WebRTCProvider
|
||||
from homeassistant.components.go2rtc.const import (
|
||||
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
|
||||
from homeassistant.components import camera, ffmpeg
|
||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||
from homeassistant.components.camera.img_util import TurboJPEGSingleton
|
||||
from homeassistant.components.camera import TurboJPEGSingleton
|
||||
from homeassistant.components.event import EventDeviceClass
|
||||
from homeassistant.components.homekit.accessories import HomeBridge
|
||||
from homeassistant.components.homekit.const import (
|
||||
|
||||
@@ -1005,7 +1005,7 @@ async def test_get_image(hass: HomeAssistant, h264_video, filename) -> None:
|
||||
|
||||
# Since libjpeg-turbo is not installed on the CI runner, we use a mock
|
||||
with patch(
|
||||
"homeassistant.components.camera.img_util.TurboJPEGSingleton"
|
||||
"homeassistant.components.camera.TurboJPEGSingleton"
|
||||
) as mock_turbo_jpeg_singleton:
|
||||
mock_turbo_jpeg_singleton.instance.return_value = mock_turbo_jpeg()
|
||||
stream = create_stream(hass, h264_video, {}, dynamic_stream_settings())
|
||||
@@ -1068,7 +1068,7 @@ async def test_get_image_rotated(hass: HomeAssistant, h264_video, filename) -> N
|
||||
|
||||
# Since libjpeg-turbo is not installed on the CI runner, we use a mock
|
||||
with patch(
|
||||
"homeassistant.components.camera.img_util.TurboJPEGSingleton"
|
||||
"homeassistant.components.camera.TurboJPEGSingleton"
|
||||
) as mock_turbo_jpeg_singleton:
|
||||
mock_turbo_jpeg_singleton.instance.return_value = mock_turbo_jpeg()
|
||||
for orientation in (Orientation.NO_TRANSFORM, Orientation.ROTATE_RIGHT):
|
||||
|
||||
@@ -21,8 +21,8 @@ from homeassistant.components.camera import (
|
||||
async_get_image,
|
||||
async_get_stream_source,
|
||||
async_register_webrtc_provider,
|
||||
get_camera_from_entity_id,
|
||||
)
|
||||
from homeassistant.components.camera.helper import get_camera_from_entity_id
|
||||
from homeassistant.components.unifiprotect.const import (
|
||||
ATTR_BITRATE,
|
||||
ATTR_CHANNEL_ID,
|
||||
|
||||
Reference in New Issue
Block a user