From 488a636aecd0d73da5b2b04e3a337dc8c8fb1e2c Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Thu, 14 Oct 2021 13:03:38 -0400 Subject: [PATCH] Clean up unused loggers (#57662) --- homeassistant/auth/permissions/__init__.py | 3 --- homeassistant/components/adax/climate.py | 3 --- homeassistant/components/asuswrt/sensor.py | 3 --- homeassistant/components/climacell/sensor.py | 3 --- homeassistant/components/climacell/weather.py | 3 --- homeassistant/components/co2signal/config_flow.py | 3 --- homeassistant/components/econet/climate.py | 4 ---- homeassistant/components/generic_hygrostat/__init__.py | 4 ---- homeassistant/components/gogogate2/cover.py | 4 ---- homeassistant/components/group/binary_sensor.py | 3 --- homeassistant/components/hyperion/camera.py | 3 --- homeassistant/components/ialarm/alarm_control_panel.py | 4 ---- homeassistant/components/keenetic_ndms2/binary_sensor.py | 4 ---- homeassistant/components/kraken/config_flow.py | 3 --- homeassistant/components/litejet/config_flow.py | 3 --- homeassistant/components/litejet/scene.py | 3 --- homeassistant/components/lyric/api.py | 3 --- homeassistant/components/lyric/config_flow.py | 2 -- homeassistant/components/meteoclimatic/sensor.py | 4 ---- homeassistant/components/modbus/__init__.py | 3 --- homeassistant/components/modbus/binary_sensor.py | 2 -- homeassistant/components/modbus/climate.py | 2 -- homeassistant/components/modbus/cover.py | 2 -- homeassistant/components/modbus/fan.py | 2 -- homeassistant/components/modbus/light.py | 2 -- homeassistant/components/modbus/sensor.py | 2 -- homeassistant/components/modbus/switch.py | 2 -- homeassistant/components/motioneye/camera.py | 3 --- homeassistant/components/motioneye/config_flow.py | 3 --- homeassistant/components/mullvad/config_flow.py | 4 ---- homeassistant/components/myq/cover.py | 4 ---- homeassistant/components/myq/light.py | 4 ---- homeassistant/components/mysensors/config_flow.py | 3 --- homeassistant/components/mysensors/cover.py | 3 --- homeassistant/components/netgear/__init__.py | 4 ---- homeassistant/components/netgear/sensor.py | 5 ----- homeassistant/components/ozw/websocket_api.py | 4 ---- homeassistant/components/panasonic_viera/remote.py | 4 ---- homeassistant/components/plaato/binary_sensor.py | 4 ---- homeassistant/components/plaato/config_flow.py | 4 ---- homeassistant/components/screenlogic/binary_sensor.py | 4 ---- homeassistant/components/screenlogic/sensor.py | 4 ---- homeassistant/components/smarttub/__init__.py | 4 ---- homeassistant/components/smarttub/binary_sensor.py | 4 ---- homeassistant/components/smarttub/climate.py | 4 ---- homeassistant/components/smarttub/config_flow.py | 5 ----- homeassistant/components/smarttub/entity.py | 4 ---- homeassistant/components/smarttub/light.py | 4 ---- homeassistant/components/smarttub/sensor.py | 3 --- homeassistant/components/smarttub/switch.py | 4 ---- homeassistant/components/sonarr/__init__.py | 2 -- homeassistant/components/sonos/binary_sensor.py | 3 --- homeassistant/components/sonos/config_flow.py | 4 ---- homeassistant/components/sonos/sensor.py | 4 ---- homeassistant/components/stream/hls.py | 3 --- homeassistant/components/surepetcare/lock.py | 3 --- homeassistant/components/surepetcare/sensor.py | 3 --- homeassistant/components/syncthing/config_flow.py | 4 ---- homeassistant/components/syncthing/sensor.py | 4 ---- homeassistant/components/syncthru/binary_sensor.py | 4 ---- homeassistant/components/unifi/switch.py | 3 --- homeassistant/components/velbus/climate.py | 4 ---- homeassistant/components/velbus/cover.py | 4 ---- homeassistant/components/velbus/light.py | 4 ---- homeassistant/components/velbus/switch.py | 3 --- homeassistant/components/waze_travel_time/__init__.py | 3 --- homeassistant/components/wemo/binary_sensor.py | 3 --- homeassistant/components/wemo/fan.py | 3 --- homeassistant/components/wemo/light.py | 3 --- homeassistant/components/wemo/switch.py | 3 --- homeassistant/components/xiaomi_miio/binary_sensor.py | 4 ---- homeassistant/components/zha/alarm_control_panel.py | 4 ---- homeassistant/components/zha/core/channels/security.py | 3 --- homeassistant/components/zha/core/registries.py | 2 -- homeassistant/components/zwave_js/triggers/value_updated.py | 3 --- homeassistant/helpers/entity_platform.py | 3 --- tests/components/climacell/test_config_flow.py | 3 --- tests/components/climacell/test_init.py | 4 ---- tests/components/climacell/test_sensor.py | 2 -- tests/components/climacell/test_weather.py | 3 --- tests/components/hyperion/test_camera.py | 2 -- tests/components/litejet/test_light.py | 4 ---- tests/components/litejet/test_switch.py | 4 ---- tests/components/modbus/conftest.py | 2 -- tests/components/motioneye/test_config_flow.py | 3 --- tests/components/motioneye/test_web_hooks.py | 4 ---- tests/components/netgear/test_config_flow.py | 3 --- tests/components/sia/test_config_flow.py | 4 ---- 88 files changed, 292 deletions(-) diff --git a/homeassistant/auth/permissions/__init__.py b/homeassistant/auth/permissions/__init__.py index 694ea2b737..101c331b84 100644 --- a/homeassistant/auth/permissions/__init__.py +++ b/homeassistant/auth/permissions/__init__.py @@ -2,7 +2,6 @@ from __future__ import annotations from collections.abc import Callable -import logging from typing import Any import voluptuous as vol @@ -16,8 +15,6 @@ from .util import test_all POLICY_SCHEMA = vol.Schema({vol.Optional(CAT_ENTITIES): ENTITY_POLICY_SCHEMA}) -_LOGGER = logging.getLogger(__name__) - class AbstractPermissions: """Default permissions class.""" diff --git a/homeassistant/components/adax/climate.py b/homeassistant/components/adax/climate.py index 1abd83fdbf..674329aaf6 100644 --- a/homeassistant/components/adax/climate.py +++ b/homeassistant/components/adax/climate.py @@ -1,7 +1,6 @@ """Support for Adax wifi-enabled home heaters.""" from __future__ import annotations -import logging from typing import Any from adax import Adax @@ -25,8 +24,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import ACCOUNT_ID -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/asuswrt/sensor.py b/homeassistant/components/asuswrt/sensor.py index 5392b419bc..4b865bfb0e 100644 --- a/homeassistant/components/asuswrt/sensor.py +++ b/homeassistant/components/asuswrt/sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from dataclasses import dataclass -import logging from numbers import Real from homeassistant.components.sensor import ( @@ -114,8 +113,6 @@ CONNECTION_SENSORS: tuple[AsusWrtSensorEntityDescription, ...] = ( ), ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/climacell/sensor.py b/homeassistant/components/climacell/sensor.py index 1ba5bbe3a3..07bc4790b5 100644 --- a/homeassistant/components/climacell/sensor.py +++ b/homeassistant/components/climacell/sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from abc import abstractmethod -import logging from pyclimacell.const import CURRENT @@ -21,8 +20,6 @@ from .const import ( ClimaCellSensorEntityDescription, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/climacell/weather.py b/homeassistant/components/climacell/weather.py index 865c2baa33..cb0783c6be 100644 --- a/homeassistant/components/climacell/weather.py +++ b/homeassistant/components/climacell/weather.py @@ -4,7 +4,6 @@ from __future__ import annotations from abc import abstractmethod from collections.abc import Mapping from datetime import datetime -import logging from typing import Any from pyclimacell.const import ( @@ -94,8 +93,6 @@ from .const import ( MAX_FORECASTS, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/co2signal/config_flow.py b/homeassistant/components/co2signal/config_flow.py index e3862d6347..e7f94e4d60 100644 --- a/homeassistant/components/co2signal/config_flow.py +++ b/homeassistant/components/co2signal/config_flow.py @@ -1,7 +1,6 @@ """Config flow for Co2signal integration.""" from __future__ import annotations -import logging from typing import Any import voluptuous as vol @@ -15,8 +14,6 @@ from . import APIRatelimitExceeded, CO2Error, InvalidAuth, UnknownError, get_dat from .const import CONF_COUNTRY_CODE, DOMAIN from .util import get_extra_name -_LOGGER = logging.getLogger(__name__) - TYPE_USE_HOME = "Use home location" TYPE_SPECIFY_COORDINATES = "Specify coordinates" TYPE_SPECIFY_COUNTRY = "Specify country code" diff --git a/homeassistant/components/econet/climate.py b/homeassistant/components/econet/climate.py index fe50855d55..24bac51646 100644 --- a/homeassistant/components/econet/climate.py +++ b/homeassistant/components/econet/climate.py @@ -1,6 +1,4 @@ """Support for Rheem EcoNet thermostats.""" -import logging - from pyeconet.equipment import EquipmentType from pyeconet.equipment.thermostat import ThermostatFanMode, ThermostatOperationMode @@ -28,8 +26,6 @@ from homeassistant.const import ATTR_TEMPERATURE from . import EcoNetEntity from .const import DOMAIN, EQUIPMENT -_LOGGER = logging.getLogger(__name__) - ECONET_STATE_TO_HA = { ThermostatOperationMode.HEATING: HVAC_MODE_HEAT, ThermostatOperationMode.COOLING: HVAC_MODE_COOL, diff --git a/homeassistant/components/generic_hygrostat/__init__.py b/homeassistant/components/generic_hygrostat/__init__.py index 568863adb7..b58c98b1d0 100644 --- a/homeassistant/components/generic_hygrostat/__init__.py +++ b/homeassistant/components/generic_hygrostat/__init__.py @@ -1,7 +1,5 @@ """The generic_hygrostat component.""" -import logging - import voluptuous as vol from homeassistant.components.humidifier.const import ( @@ -13,8 +11,6 @@ from homeassistant.helpers import config_validation as cv, discovery DOMAIN = "generic_hygrostat" -_LOGGER = logging.getLogger(__name__) - CONF_HUMIDIFIER = "humidifier" CONF_SENSOR = "target_sensor" CONF_MIN_HUMIDITY = "min_humidity" diff --git a/homeassistant/components/gogogate2/cover.py b/homeassistant/components/gogogate2/cover.py index 073c48e55b..fb5871e863 100644 --- a/homeassistant/components/gogogate2/cover.py +++ b/homeassistant/components/gogogate2/cover.py @@ -1,8 +1,6 @@ """Support for Gogogate2 garage Doors.""" from __future__ import annotations -import logging - from ismartgate.common import ( AbstractDoor, DoorStatus, @@ -28,8 +26,6 @@ from .common import ( get_data_update_coordinator, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/group/binary_sensor.py b/homeassistant/components/group/binary_sensor.py index 24d6cb86aa..613b21571d 100644 --- a/homeassistant/components/group/binary_sensor.py +++ b/homeassistant/components/group/binary_sensor.py @@ -1,7 +1,6 @@ """This platform allows several binary sensor to be grouped into one binary sensor.""" from __future__ import annotations -import logging from typing import Any import voluptuous as vol @@ -34,8 +33,6 @@ DEFAULT_NAME = "Binary Sensor Group" CONF_ALL = "all" REG_KEY = f"{BINARY_SENSOR_DOMAIN}_registry" -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_ENTITIES): cv.entities_domain(BINARY_SENSOR_DOMAIN), diff --git a/homeassistant/components/hyperion/camera.py b/homeassistant/components/hyperion/camera.py index 809449543a..d172d00c02 100644 --- a/homeassistant/components/hyperion/camera.py +++ b/homeassistant/components/hyperion/camera.py @@ -8,7 +8,6 @@ import binascii from collections.abc import AsyncGenerator from contextlib import asynccontextmanager import functools -import logging from typing import Any from aiohttp import web @@ -50,8 +49,6 @@ from .const import ( TYPE_HYPERION_CAMERA, ) -_LOGGER = logging.getLogger(__name__) - IMAGE_STREAM_JPG_SENTINEL = "data:image/jpg;base64," diff --git a/homeassistant/components/ialarm/alarm_control_panel.py b/homeassistant/components/ialarm/alarm_control_panel.py index a33162b7af..fc758dd617 100644 --- a/homeassistant/components/ialarm/alarm_control_panel.py +++ b/homeassistant/components/ialarm/alarm_control_panel.py @@ -1,6 +1,4 @@ """Interfaces with iAlarm control panels.""" -import logging - from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, @@ -10,8 +8,6 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DATA_COORDINATOR, DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities) -> None: """Set up a iAlarm alarm control panel based on a config entry.""" diff --git a/homeassistant/components/keenetic_ndms2/binary_sensor.py b/homeassistant/components/keenetic_ndms2/binary_sensor.py index e8f7df0248..aa46c0fab0 100644 --- a/homeassistant/components/keenetic_ndms2/binary_sensor.py +++ b/homeassistant/components/keenetic_ndms2/binary_sensor.py @@ -1,6 +1,4 @@ """The Keenetic Client class.""" -import logging - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_CONNECTIVITY, BinarySensorEntity, @@ -12,8 +10,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import KeeneticRouter from .const import DOMAIN, ROUTER -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/kraken/config_flow.py b/homeassistant/components/kraken/config_flow.py index 6844370576..b821f7a592 100644 --- a/homeassistant/components/kraken/config_flow.py +++ b/homeassistant/components/kraken/config_flow.py @@ -1,7 +1,6 @@ """Config flow for kraken integration.""" from __future__ import annotations -import logging from typing import Any import krakenex @@ -17,8 +16,6 @@ from homeassistant.helpers import config_validation as cv from .const import CONF_TRACKED_ASSET_PAIRS, DEFAULT_SCAN_INTERVAL, DOMAIN from .utils import get_tradable_asset_pairs -_LOGGER = logging.getLogger(__name__) - class KrakenConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow for kraken.""" diff --git a/homeassistant/components/litejet/config_flow.py b/homeassistant/components/litejet/config_flow.py index 4f8128bd6d..3e5422518f 100644 --- a/homeassistant/components/litejet/config_flow.py +++ b/homeassistant/components/litejet/config_flow.py @@ -1,7 +1,6 @@ """Config flow for the LiteJet lighting system.""" from __future__ import annotations -import logging from typing import Any import pylitejet @@ -16,8 +15,6 @@ import homeassistant.helpers.config_validation as cv from .const import CONF_DEFAULT_TRANSITION, DOMAIN -_LOGGER = logging.getLogger(__name__) - class LiteJetOptionsFlow(config_entries.OptionsFlow): """Handle LiteJet options.""" diff --git a/homeassistant/components/litejet/scene.py b/homeassistant/components/litejet/scene.py index 5ae0aec955..2f2ab244e1 100644 --- a/homeassistant/components/litejet/scene.py +++ b/homeassistant/components/litejet/scene.py @@ -1,13 +1,10 @@ """Support for LiteJet scenes.""" -import logging from typing import Any from homeassistant.components.scene import Scene from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - ATTR_NUMBER = "number" diff --git a/homeassistant/components/lyric/api.py b/homeassistant/components/lyric/api.py index 4d95516517..3b23f802de 100644 --- a/homeassistant/components/lyric/api.py +++ b/homeassistant/components/lyric/api.py @@ -1,5 +1,4 @@ """API for Honeywell Lyric bound to Home Assistant OAuth.""" -import logging from typing import cast from aiohttp import BasicAuth, ClientSession @@ -8,8 +7,6 @@ from aiolyric.client import LyricClient from homeassistant.helpers import config_entry_oauth2_flow from homeassistant.helpers.aiohttp_client import async_get_clientsession -_LOGGER = logging.getLogger(__name__) - class ConfigEntryLyricClient(LyricClient): """Provide Honeywell Lyric authentication tied to an OAuth2 based config entry.""" diff --git a/homeassistant/components/lyric/config_flow.py b/homeassistant/components/lyric/config_flow.py index 73040d51e1..3834111320 100644 --- a/homeassistant/components/lyric/config_flow.py +++ b/homeassistant/components/lyric/config_flow.py @@ -7,8 +7,6 @@ from homeassistant.helpers import config_entry_oauth2_flow from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - class OAuth2FlowHandler( config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN diff --git a/homeassistant/components/meteoclimatic/sensor.py b/homeassistant/components/meteoclimatic/sensor.py index d3ecb44ce7..e4f7a1525d 100644 --- a/homeassistant/components/meteoclimatic/sensor.py +++ b/homeassistant/components/meteoclimatic/sensor.py @@ -1,6 +1,4 @@ """Support for Meteoclimatic sensor.""" -import logging - from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ATTRIBUTION @@ -12,8 +10,6 @@ from homeassistant.helpers.update_coordinator import ( from .const import ATTRIBUTION, DOMAIN, MANUFACTURER, MODEL, SENSOR_TYPES -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/modbus/__init__.py b/homeassistant/components/modbus/__init__.py index b7a1e9db8e..720e57605c 100644 --- a/homeassistant/components/modbus/__init__.py +++ b/homeassistant/components/modbus/__init__.py @@ -1,7 +1,6 @@ """Support for Modbus.""" from __future__ import annotations -import logging from typing import cast import voluptuous as vol @@ -129,8 +128,6 @@ from .validators import ( struct_validator, ) -_LOGGER = logging.getLogger(__name__) - BASE_SCHEMA = vol.Schema({vol.Optional(CONF_NAME, default=DEFAULT_HUB): cv.string}) diff --git a/homeassistant/components/modbus/binary_sensor.py b/homeassistant/components/modbus/binary_sensor.py index d3a8578f47..171486639f 100644 --- a/homeassistant/components/modbus/binary_sensor.py +++ b/homeassistant/components/modbus/binary_sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.const import CONF_BINARY_SENSORS, CONF_NAME, STATE_ON @@ -15,7 +14,6 @@ from . import get_hub from .base_platform import BasePlatform PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/climate.py b/homeassistant/components/modbus/climate.py index 1b1a09cf9c..a526e7cc2f 100644 --- a/homeassistant/components/modbus/climate.py +++ b/homeassistant/components/modbus/climate.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging import struct from typing import Any @@ -45,7 +44,6 @@ from .const import ( from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/cover.py b/homeassistant/components/modbus/cover.py index 805f07bad4..152239e88c 100644 --- a/homeassistant/components/modbus/cover.py +++ b/homeassistant/components/modbus/cover.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging from typing import Any from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverEntity @@ -37,7 +36,6 @@ from .const import ( from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/fan.py b/homeassistant/components/modbus/fan.py index 349ae0d061..62532cc93a 100644 --- a/homeassistant/components/modbus/fan.py +++ b/homeassistant/components/modbus/fan.py @@ -1,7 +1,6 @@ """Support for Modbus fans.""" from __future__ import annotations -import logging from typing import Any from homeassistant.components.fan import FanEntity @@ -16,7 +15,6 @@ from .const import CONF_FANS from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/light.py b/homeassistant/components/modbus/light.py index f0f2541ad0..cc5936050e 100644 --- a/homeassistant/components/modbus/light.py +++ b/homeassistant/components/modbus/light.py @@ -1,7 +1,6 @@ """Support for Modbus lights.""" from __future__ import annotations -import logging from typing import Any from homeassistant.components.light import LightEntity @@ -15,7 +14,6 @@ from .base_platform import BaseSwitch from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/sensor.py b/homeassistant/components/modbus/sensor.py index 6702e6f22d..4cf642ca44 100644 --- a/homeassistant/components/modbus/sensor.py +++ b/homeassistant/components/modbus/sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging from typing import Any from homeassistant.components.sensor import CONF_STATE_CLASS, SensorEntity @@ -17,7 +16,6 @@ from .base_platform import BaseStructPlatform from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/modbus/switch.py b/homeassistant/components/modbus/switch.py index 86cba7c36f..5844daf648 100644 --- a/homeassistant/components/modbus/switch.py +++ b/homeassistant/components/modbus/switch.py @@ -1,7 +1,6 @@ """Support for Modbus switches.""" from __future__ import annotations -import logging from typing import Any from homeassistant.components.switch import SwitchEntity @@ -15,7 +14,6 @@ from .base_platform import BaseSwitch from .modbus import ModbusHub PARALLEL_UPDATES = 1 -_LOGGER = logging.getLogger(__name__) async def async_setup_platform( diff --git a/homeassistant/components/motioneye/camera.py b/homeassistant/components/motioneye/camera.py index e7ff75812f..3e8df99e0a 100644 --- a/homeassistant/components/motioneye/camera.py +++ b/homeassistant/components/motioneye/camera.py @@ -1,7 +1,6 @@ """The motionEye integration.""" from __future__ import annotations -import logging from types import MappingProxyType from typing import Any @@ -49,8 +48,6 @@ from .const import ( TYPE_MOTIONEYE_MJPEG_CAMERA, ) -_LOGGER = logging.getLogger(__name__) - PLATFORMS = ["camera"] diff --git a/homeassistant/components/motioneye/config_flow.py b/homeassistant/components/motioneye/config_flow.py index a5f92a3ce0..a767cf7eca 100644 --- a/homeassistant/components/motioneye/config_flow.py +++ b/homeassistant/components/motioneye/config_flow.py @@ -1,7 +1,6 @@ """Config flow for motionEye integration.""" from __future__ import annotations -import logging from typing import Any, Dict, cast from motioneye_client.client import ( @@ -36,8 +35,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - class MotionEyeConfigFlow(ConfigFlow, domain=DOMAIN): """Handle a config flow for motionEye.""" diff --git a/homeassistant/components/mullvad/config_flow.py b/homeassistant/components/mullvad/config_flow.py index 1b330d4f6a..5b6ef78133 100644 --- a/homeassistant/components/mullvad/config_flow.py +++ b/homeassistant/components/mullvad/config_flow.py @@ -1,14 +1,10 @@ """Config flow for Mullvad VPN integration.""" -import logging - from mullvad_api import MullvadAPI, MullvadAPIError from homeassistant import config_entries from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow for Mullvad VPN.""" diff --git a/homeassistant/components/myq/cover.py b/homeassistant/components/myq/cover.py index e8e06dc3b2..4379137b3f 100644 --- a/homeassistant/components/myq/cover.py +++ b/homeassistant/components/myq/cover.py @@ -1,6 +1,4 @@ """Support for MyQ-Enabled Garage Doors.""" -import logging - from pymyq.const import DEVICE_TYPE_GATE as MYQ_DEVICE_TYPE_GATE from pymyq.errors import MyQError @@ -17,8 +15,6 @@ from homeassistant.exceptions import HomeAssistantError from . import MyQEntity from .const import DOMAIN, MYQ_COORDINATOR, MYQ_GATEWAY, MYQ_TO_HASS -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up mysq covers.""" diff --git a/homeassistant/components/myq/light.py b/homeassistant/components/myq/light.py index d8154d7c42..fb3666b62b 100644 --- a/homeassistant/components/myq/light.py +++ b/homeassistant/components/myq/light.py @@ -1,6 +1,4 @@ """Support for MyQ-Enabled lights.""" -import logging - from pymyq.errors import MyQError from homeassistant.components.light import LightEntity @@ -10,8 +8,6 @@ from homeassistant.exceptions import HomeAssistantError from . import MyQEntity from .const import DOMAIN, MYQ_COORDINATOR, MYQ_GATEWAY, MYQ_TO_HASS -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up myq lights.""" diff --git a/homeassistant/components/mysensors/config_flow.py b/homeassistant/components/mysensors/config_flow.py index 920cb40b7a..aea15e7b8a 100644 --- a/homeassistant/components/mysensors/config_flow.py +++ b/homeassistant/components/mysensors/config_flow.py @@ -1,7 +1,6 @@ """Config flow for MySensors.""" from __future__ import annotations -import logging import os from typing import Any @@ -46,8 +45,6 @@ from .const import ( ) from .gateway import MQTT_COMPONENT, is_serial_port, is_socket_address, try_connect -_LOGGER = logging.getLogger(__name__) - def _get_schema_common(user_input: dict[str, str]) -> dict: """Create a schema with options common to all gateway types.""" diff --git a/homeassistant/components/mysensors/cover.py b/homeassistant/components/mysensors/cover.py index bab7a07a86..9219097bea 100644 --- a/homeassistant/components/mysensors/cover.py +++ b/homeassistant/components/mysensors/cover.py @@ -2,7 +2,6 @@ from __future__ import annotations from enum import Enum, unique -import logging from typing import Any from homeassistant.components import mysensors @@ -16,8 +15,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from .helpers import on_unload -_LOGGER = logging.getLogger(__name__) - @unique class CoverState(Enum): diff --git a/homeassistant/components/netgear/__init__.py b/homeassistant/components/netgear/__init__.py index 395773c5fe..301fb780c1 100644 --- a/homeassistant/components/netgear/__init__.py +++ b/homeassistant/components/netgear/__init__.py @@ -1,6 +1,4 @@ """Support for Netgear routers.""" -import logging - from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady @@ -11,8 +9,6 @@ from .const import DOMAIN, PLATFORMS from .errors import CannotLoginException from .router import NetgearRouter -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool: """Set up Netgear component.""" diff --git a/homeassistant/components/netgear/sensor.py b/homeassistant/components/netgear/sensor.py index d5b8bfd368..57ffe6f98f 100644 --- a/homeassistant/components/netgear/sensor.py +++ b/homeassistant/components/netgear/sensor.py @@ -1,6 +1,4 @@ """Support for Netgear routers.""" -import logging - from homeassistant.components.sensor import ( DEVICE_CLASS_SIGNAL_STRENGTH, SensorEntity, @@ -14,9 +12,6 @@ from homeassistant.helpers.typing import HomeAssistantType from .router import NetgearDeviceEntity, NetgearRouter, async_setup_netgear_entry -_LOGGER = logging.getLogger(__name__) - - SENSOR_TYPES = { "type": SensorEntityDescription( key="type", diff --git a/homeassistant/components/ozw/websocket_api.py b/homeassistant/components/ozw/websocket_api.py index bb55a686db..45c0a11384 100644 --- a/homeassistant/components/ozw/websocket_api.py +++ b/homeassistant/components/ozw/websocket_api.py @@ -1,6 +1,4 @@ """Web socket API for OpenZWave.""" -import logging - from openzwavemqtt.const import ( ATTR_CODE_SLOT, ATTR_LABEL, @@ -26,8 +24,6 @@ from homeassistant.helpers import config_validation as cv from .const import ATTR_CONFIG_PARAMETER, ATTR_CONFIG_VALUE, DOMAIN, MANAGER from .lock import ATTR_USERCODE -_LOGGER = logging.getLogger(__name__) - DRY_RUN = "dry_run" TYPE = "type" ID = "id" diff --git a/homeassistant/components/panasonic_viera/remote.py b/homeassistant/components/panasonic_viera/remote.py index 8f3fab8021..acd1d49f1b 100644 --- a/homeassistant/components/panasonic_viera/remote.py +++ b/homeassistant/components/panasonic_viera/remote.py @@ -1,6 +1,4 @@ """Remote control support for Panasonic Viera TV.""" -import logging - from homeassistant.components.remote import RemoteEntity from homeassistant.const import CONF_NAME, STATE_ON @@ -15,8 +13,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Panasonic Viera TV Remote from a config entry.""" diff --git a/homeassistant/components/plaato/binary_sensor.py b/homeassistant/components/plaato/binary_sensor.py index 27150692d6..52213d4679 100644 --- a/homeassistant/components/plaato/binary_sensor.py +++ b/homeassistant/components/plaato/binary_sensor.py @@ -1,7 +1,5 @@ """Support for Plaato Airlock sensors.""" -import logging - from pyplaato.plaato import PlaatoKeg from homeassistant.components.binary_sensor import ( @@ -13,8 +11,6 @@ from homeassistant.components.binary_sensor import ( from .const import CONF_USE_WEBHOOK, COORDINATOR, DOMAIN from .entity import PlaatoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Plaato from a config entry.""" diff --git a/homeassistant/components/plaato/config_flow.py b/homeassistant/components/plaato/config_flow.py index 79a4657c31..3bd3e9f006 100644 --- a/homeassistant/components/plaato/config_flow.py +++ b/homeassistant/components/plaato/config_flow.py @@ -1,6 +1,4 @@ """Config flow for Plaato.""" -import logging - from pyplaato.plaato import PlaatoDeviceType import voluptuous as vol @@ -24,8 +22,6 @@ from .const import ( PLACEHOLDER_WEBHOOK_URL, ) -_LOGGER = logging.getLogger(__package__) - class PlaatoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handles a Plaato config flow.""" diff --git a/homeassistant/components/screenlogic/binary_sensor.py b/homeassistant/components/screenlogic/binary_sensor.py index 649e692540..f5d95d03be 100644 --- a/homeassistant/components/screenlogic/binary_sensor.py +++ b/homeassistant/components/screenlogic/binary_sensor.py @@ -1,6 +1,4 @@ """Support for a ScreenLogic Binary Sensor.""" -import logging - from screenlogicpy.const import DATA as SL_DATA, DEVICE_TYPE, EQUIPMENT, ON_OFF from homeassistant.components.binary_sensor import ( @@ -11,8 +9,6 @@ from homeassistant.components.binary_sensor import ( from . import ScreenlogicEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {DEVICE_TYPE.ALARM: DEVICE_CLASS_PROBLEM} diff --git a/homeassistant/components/screenlogic/sensor.py b/homeassistant/components/screenlogic/sensor.py index 7e8a0dbf60..357e771f6b 100644 --- a/homeassistant/components/screenlogic/sensor.py +++ b/homeassistant/components/screenlogic/sensor.py @@ -1,6 +1,4 @@ """Support for a ScreenLogic Sensor.""" -import logging - from screenlogicpy.const import ( CHEM_DOSING_STATE, DATA as SL_DATA, @@ -17,8 +15,6 @@ from homeassistant.components.sensor import ( from . import ScreenlogicEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - SUPPORTED_CHEM_SENSORS = ( "calcium_harness", "current_orp", diff --git a/homeassistant/components/smarttub/__init__.py b/homeassistant/components/smarttub/__init__.py index a396b50840..89ad9222e7 100644 --- a/homeassistant/components/smarttub/__init__.py +++ b/homeassistant/components/smarttub/__init__.py @@ -1,11 +1,7 @@ """SmartTub integration.""" -import logging - from .const import DOMAIN, SMARTTUB_CONTROLLER from .controller import SmartTubController -_LOGGER = logging.getLogger(__name__) - PLATFORMS = ["binary_sensor", "climate", "light", "sensor", "switch"] diff --git a/homeassistant/components/smarttub/binary_sensor.py b/homeassistant/components/smarttub/binary_sensor.py index 6ddeccadc7..a3422e27d8 100644 --- a/homeassistant/components/smarttub/binary_sensor.py +++ b/homeassistant/components/smarttub/binary_sensor.py @@ -1,8 +1,6 @@ """Platform for binary sensor integration.""" from __future__ import annotations -import logging - from smarttub import SpaError, SpaReminder import voluptuous as vol @@ -16,8 +14,6 @@ from homeassistant.helpers import entity_platform from .const import ATTR_ERRORS, ATTR_REMINDERS, DOMAIN, SMARTTUB_CONTROLLER from .entity import SmartTubEntity, SmartTubSensorBase -_LOGGER = logging.getLogger(__name__) - # whether the reminder has been snoozed (bool) ATTR_REMINDER_SNOOZED = "snoozed" diff --git a/homeassistant/components/smarttub/climate.py b/homeassistant/components/smarttub/climate.py index be564c84a9..b089098546 100644 --- a/homeassistant/components/smarttub/climate.py +++ b/homeassistant/components/smarttub/climate.py @@ -1,6 +1,4 @@ """Platform for climate integration.""" -import logging - from smarttub import Spa from homeassistant.components.climate import ClimateEntity @@ -19,8 +17,6 @@ from homeassistant.util.temperature import convert as convert_temperature from .const import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP, DOMAIN, SMARTTUB_CONTROLLER from .entity import SmartTubEntity -_LOGGER = logging.getLogger(__name__) - PRESET_DAY = "day" PRESET_MODES = { diff --git a/homeassistant/components/smarttub/config_flow.py b/homeassistant/components/smarttub/config_flow.py index 652aec746a..88ec38e8d6 100644 --- a/homeassistant/components/smarttub/config_flow.py +++ b/homeassistant/components/smarttub/config_flow.py @@ -1,6 +1,4 @@ """Config flow to configure the SmartTub integration.""" -import logging - from smarttub import LoginFailed import voluptuous as vol @@ -10,9 +8,6 @@ from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from .const import DOMAIN from .controller import SmartTubController -_LOGGER = logging.getLogger(__name__) - - DATA_SCHEMA = vol.Schema( {vol.Required(CONF_EMAIL): str, vol.Required(CONF_PASSWORD): str} ) diff --git a/homeassistant/components/smarttub/entity.py b/homeassistant/components/smarttub/entity.py index 4bf20868ee..49d5e94d76 100644 --- a/homeassistant/components/smarttub/entity.py +++ b/homeassistant/components/smarttub/entity.py @@ -1,6 +1,4 @@ """Base classes for SmartTub entities.""" -import logging - import smarttub from homeassistant.helpers.entity import DeviceInfo @@ -12,8 +10,6 @@ from homeassistant.helpers.update_coordinator import ( from .const import DOMAIN from .helpers import get_spa_name -_LOGGER = logging.getLogger(__name__) - class SmartTubEntity(CoordinatorEntity): """Base class for SmartTub entities.""" diff --git a/homeassistant/components/smarttub/light.py b/homeassistant/components/smarttub/light.py index 1e4229ee4e..8d03879a0a 100644 --- a/homeassistant/components/smarttub/light.py +++ b/homeassistant/components/smarttub/light.py @@ -1,6 +1,4 @@ """Platform for light integration.""" -import logging - from smarttub import SpaLight from homeassistant.components.light import ( @@ -22,8 +20,6 @@ from .const import ( from .entity import SmartTubEntity from .helpers import get_spa_name -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up entities for any lights in the tub.""" diff --git a/homeassistant/components/smarttub/sensor.py b/homeassistant/components/smarttub/sensor.py index 9922792ba1..690873cc8b 100644 --- a/homeassistant/components/smarttub/sensor.py +++ b/homeassistant/components/smarttub/sensor.py @@ -1,6 +1,5 @@ """Platform for sensor integration.""" from enum import Enum -import logging import smarttub import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.helpers import config_validation as cv, entity_platform from .const import DOMAIN, SMARTTUB_CONTROLLER from .entity import SmartTubSensorBase -_LOGGER = logging.getLogger(__name__) - # the desired duration, in hours, of the cycle ATTR_DURATION = "duration" ATTR_CYCLE_LAST_UPDATED = "cycle_last_updated" diff --git a/homeassistant/components/smarttub/switch.py b/homeassistant/components/smarttub/switch.py index 7cab25e6cf..4ce8d7a683 100644 --- a/homeassistant/components/smarttub/switch.py +++ b/homeassistant/components/smarttub/switch.py @@ -1,6 +1,4 @@ """Platform for switch integration.""" -import logging - import async_timeout from smarttub import SpaPump @@ -10,8 +8,6 @@ from .const import API_TIMEOUT, ATTR_PUMPS, DOMAIN, SMARTTUB_CONTROLLER from .entity import SmartTubEntity from .helpers import get_spa_name -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up switch entities for the pumps on the tub.""" diff --git a/homeassistant/components/sonarr/__init__.py b/homeassistant/components/sonarr/__init__.py index f0969d063c..b2cc13abc3 100644 --- a/homeassistant/components/sonarr/__init__.py +++ b/homeassistant/components/sonarr/__init__.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import timedelta -import logging from sonarr import Sonarr, SonarrAccessRestricted, SonarrError @@ -30,7 +29,6 @@ from .const import ( PLATFORMS = ["sensor"] SCAN_INTERVAL = timedelta(seconds=30) -_LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/sonos/binary_sensor.py b/homeassistant/components/sonos/binary_sensor.py index 8583132521..730a6367ed 100644 --- a/homeassistant/components/sonos/binary_sensor.py +++ b/homeassistant/components/sonos/binary_sensor.py @@ -1,7 +1,6 @@ """Entity representing a Sonos power sensor.""" from __future__ import annotations -import logging from typing import Any from homeassistant.components.binary_sensor import ( @@ -14,8 +13,6 @@ from .const import SONOS_CREATE_BATTERY from .entity import SonosEntity from .speaker import SonosSpeaker -_LOGGER = logging.getLogger(__name__) - ATTR_BATTERY_POWER_SOURCE = "power_source" diff --git a/homeassistant/components/sonos/config_flow.py b/homeassistant/components/sonos/config_flow.py index 3fa3bbb8fa..745d3db389 100644 --- a/homeassistant/components/sonos/config_flow.py +++ b/homeassistant/components/sonos/config_flow.py @@ -1,6 +1,4 @@ """Config flow for SONOS.""" -import logging - import soco from homeassistant import config_entries @@ -13,8 +11,6 @@ from homeassistant.helpers.typing import DiscoveryInfoType from .const import DATA_SONOS_DISCOVERY_MANAGER, DOMAIN from .helpers import hostname_to_uid -_LOGGER = logging.getLogger(__name__) - async def _async_has_devices(hass: HomeAssistant) -> bool: """Return if there are devices that can be discovered.""" diff --git a/homeassistant/components/sonos/sensor.py b/homeassistant/components/sonos/sensor.py index 1a13e6f55f..a71ac7cef2 100644 --- a/homeassistant/components/sonos/sensor.py +++ b/homeassistant/components/sonos/sensor.py @@ -1,8 +1,6 @@ """Entity representing a Sonos battery level.""" from __future__ import annotations -import logging - from homeassistant.components.sensor import SensorEntity from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -11,8 +9,6 @@ from .const import SONOS_CREATE_BATTERY from .entity import SonosEntity from .speaker import SonosSpeaker -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Sonos from a config entry.""" diff --git a/homeassistant/components/stream/hls.py b/homeassistant/components/stream/hls.py index 39ea9a5e8c..50b002b52b 100644 --- a/homeassistant/components/stream/hls.py +++ b/homeassistant/components/stream/hls.py @@ -1,7 +1,6 @@ """Provide functionality to stream HLS.""" from __future__ import annotations -import logging from typing import TYPE_CHECKING, cast from aiohttp import web @@ -24,8 +23,6 @@ from .fmp4utils import get_codec_string if TYPE_CHECKING: from . import Stream -_LOGGER = logging.getLogger(__name__) - @callback def async_setup_hls(hass: HomeAssistant) -> str: diff --git a/homeassistant/components/surepetcare/lock.py b/homeassistant/components/surepetcare/lock.py index 8351eea161..bb55514409 100644 --- a/homeassistant/components/surepetcare/lock.py +++ b/homeassistant/components/surepetcare/lock.py @@ -1,7 +1,6 @@ """Support for Sure PetCare Flaps locks.""" from __future__ import annotations -import logging from typing import Any from surepy.entities import SurepyEntity @@ -16,8 +15,6 @@ from . import SurePetcareDataCoordinator from .const import DOMAIN from .entity import SurePetcareEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback diff --git a/homeassistant/components/surepetcare/sensor.py b/homeassistant/components/surepetcare/sensor.py index 508ad03092..c0441d0a7f 100644 --- a/homeassistant/components/surepetcare/sensor.py +++ b/homeassistant/components/surepetcare/sensor.py @@ -1,7 +1,6 @@ """Support for Sure PetCare Flaps/Pets sensors.""" from __future__ import annotations -import logging from typing import cast from surepy.entities import SurepyEntity @@ -23,8 +22,6 @@ from . import SurePetcareDataCoordinator from .const import DOMAIN, SURE_BATT_VOLTAGE_DIFF, SURE_BATT_VOLTAGE_LOW from .entity import SurePetcareEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback diff --git a/homeassistant/components/syncthing/config_flow.py b/homeassistant/components/syncthing/config_flow.py index e6a5c99483..7421a385f0 100644 --- a/homeassistant/components/syncthing/config_flow.py +++ b/homeassistant/components/syncthing/config_flow.py @@ -1,6 +1,4 @@ """Config flow for syncthing integration.""" -import logging - import aiosyncthing import voluptuous as vol @@ -9,8 +7,6 @@ from homeassistant.const import CONF_TOKEN, CONF_URL, CONF_VERIFY_SSL from .const import DEFAULT_URL, DEFAULT_VERIFY_SSL, DOMAIN -_LOGGER = logging.getLogger(__name__) - DATA_SCHEMA = vol.Schema( { vol.Required(CONF_URL, default=DEFAULT_URL): str, diff --git a/homeassistant/components/syncthing/sensor.py b/homeassistant/components/syncthing/sensor.py index 924f8aaf66..e88636b814 100644 --- a/homeassistant/components/syncthing/sensor.py +++ b/homeassistant/components/syncthing/sensor.py @@ -1,7 +1,5 @@ """Support for monitoring the Syncthing instance.""" -import logging - import aiosyncthing from homeassistant.components.sensor import SensorEntity @@ -23,8 +21,6 @@ from .const import ( STATE_CHANGED_RECEIVED, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Syncthing sensors.""" diff --git a/homeassistant/components/syncthru/binary_sensor.py b/homeassistant/components/syncthru/binary_sensor.py index 7c4bd6fa8d..1c402fbf83 100644 --- a/homeassistant/components/syncthru/binary_sensor.py +++ b/homeassistant/components/syncthru/binary_sensor.py @@ -1,7 +1,5 @@ """Support for Samsung Printers with SyncThru web interface.""" -import logging - from pysyncthru import SyncThru, SyncthruState from homeassistant.components.binary_sensor import ( @@ -18,8 +16,6 @@ from homeassistant.helpers.update_coordinator import ( from . import device_identifiers from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - SYNCTHRU_STATE_PROBLEM = { SyncthruState.INVALID: True, SyncthruState.OFFLINE: None, diff --git a/homeassistant/components/unifi/switch.py b/homeassistant/components/unifi/switch.py index e419e2b441..eebd5014cb 100644 --- a/homeassistant/components/unifi/switch.py +++ b/homeassistant/components/unifi/switch.py @@ -4,7 +4,6 @@ Support for controlling power supply of clients which are powered over Ethernet Support for controlling network access of clients selected in option flow. Support for controlling deep packet inspection (DPI) restriction groups. """ -import logging from typing import Any from aiounifi.api import SOURCE_EVENT @@ -26,8 +25,6 @@ from .const import ATTR_MANUFACTURER, DOMAIN as UNIFI_DOMAIN from .unifi_client import UniFiClient from .unifi_entity_base import UniFiBase -_LOGGER = logging.getLogger(__name__) - BLOCK_SWITCH = "block" DPI_SWITCH = "dpi" POE_SWITCH = "poe" diff --git a/homeassistant/components/velbus/climate.py b/homeassistant/components/velbus/climate.py index 68d92bf43d..cdb049266b 100644 --- a/homeassistant/components/velbus/climate.py +++ b/homeassistant/components/velbus/climate.py @@ -1,6 +1,4 @@ """Support for Velbus thermostat.""" -import logging - from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( HVAC_MODE_HEAT, @@ -11,8 +9,6 @@ from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus switch based on config_entry.""" diff --git a/homeassistant/components/velbus/cover.py b/homeassistant/components/velbus/cover.py index 1003d341c9..53fd32fad3 100644 --- a/homeassistant/components/velbus/cover.py +++ b/homeassistant/components/velbus/cover.py @@ -1,6 +1,4 @@ """Support for Velbus covers.""" -import logging - from homeassistant.components.cover import ( ATTR_POSITION, SUPPORT_CLOSE, @@ -13,8 +11,6 @@ from homeassistant.components.cover import ( from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus switch based on config_entry.""" diff --git a/homeassistant/components/velbus/light.py b/homeassistant/components/velbus/light.py index 482bdb53e9..a252930b49 100644 --- a/homeassistant/components/velbus/light.py +++ b/homeassistant/components/velbus/light.py @@ -1,6 +1,4 @@ """Support for Velbus light.""" -import logging - from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_FLASH, @@ -16,8 +14,6 @@ from homeassistant.components.light import ( from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus switch based on config_entry.""" diff --git a/homeassistant/components/velbus/switch.py b/homeassistant/components/velbus/switch.py index 6b9609cc85..70c7e1eb45 100644 --- a/homeassistant/components/velbus/switch.py +++ b/homeassistant/components/velbus/switch.py @@ -1,5 +1,4 @@ """Support for Velbus switches.""" -import logging from typing import Any from homeassistant.components.switch import SwitchEntity @@ -7,8 +6,6 @@ from homeassistant.components.switch import SwitchEntity from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus switch based on config_entry.""" diff --git a/homeassistant/components/waze_travel_time/__init__.py b/homeassistant/components/waze_travel_time/__init__.py index 1b9db0e947..fa605d19c4 100644 --- a/homeassistant/components/waze_travel_time/__init__.py +++ b/homeassistant/components/waze_travel_time/__init__.py @@ -1,6 +1,4 @@ """The waze_travel_time component.""" -import logging - from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_registry import ( @@ -9,7 +7,6 @@ from homeassistant.helpers.entity_registry import ( ) PLATFORMS = ["sensor"] -_LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/wemo/binary_sensor.py b/homeassistant/components/wemo/binary_sensor.py index a7f1824cf4..1341d5526a 100644 --- a/homeassistant/components/wemo/binary_sensor.py +++ b/homeassistant/components/wemo/binary_sensor.py @@ -1,6 +1,5 @@ """Support for WeMo binary sensors.""" import asyncio -import logging from pywemo import Insight, Maker @@ -10,8 +9,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from .const import DOMAIN as WEMO_DOMAIN from .entity import WemoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up WeMo binary sensors.""" diff --git a/homeassistant/components/wemo/fan.py b/homeassistant/components/wemo/fan.py index 501011f841..00f9b77aa6 100644 --- a/homeassistant/components/wemo/fan.py +++ b/homeassistant/components/wemo/fan.py @@ -1,7 +1,6 @@ """Support for WeMo humidifier.""" import asyncio from datetime import timedelta -import logging import math import voluptuous as vol @@ -26,8 +25,6 @@ from .entity import WemoEntity SCAN_INTERVAL = timedelta(seconds=10) PARALLEL_UPDATES = 0 -_LOGGER = logging.getLogger(__name__) - ATTR_CURRENT_HUMIDITY = "current_humidity" ATTR_TARGET_HUMIDITY = "target_humidity" ATTR_FAN_MODE = "fan_mode" diff --git a/homeassistant/components/wemo/light.py b/homeassistant/components/wemo/light.py index 13f375ad72..4339e964b6 100644 --- a/homeassistant/components/wemo/light.py +++ b/homeassistant/components/wemo/light.py @@ -1,6 +1,5 @@ """Support for Belkin WeMo lights.""" import asyncio -import logging from pywemo.ouimeaux_device import bridge @@ -24,8 +23,6 @@ from .const import DOMAIN as WEMO_DOMAIN from .entity import WemoEntity from .wemo_device import DeviceCoordinator -_LOGGER = logging.getLogger(__name__) - SUPPORT_WEMO = ( SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP | SUPPORT_COLOR | SUPPORT_TRANSITION ) diff --git a/homeassistant/components/wemo/switch.py b/homeassistant/components/wemo/switch.py index a9ee2579c4..d1240d034b 100644 --- a/homeassistant/components/wemo/switch.py +++ b/homeassistant/components/wemo/switch.py @@ -1,7 +1,6 @@ """Support for WeMo switches.""" import asyncio from datetime import datetime, timedelta -import logging from pywemo import CoffeeMaker, Insight, Maker @@ -16,8 +15,6 @@ from .entity import WemoEntity SCAN_INTERVAL = timedelta(seconds=10) PARALLEL_UPDATES = 0 -_LOGGER = logging.getLogger(__name__) - # The WEMO_ constants below come from pywemo itself ATTR_SENSOR_STATE = "sensor_state" ATTR_SWITCH_MODE = "switch_mode" diff --git a/homeassistant/components/xiaomi_miio/binary_sensor.py b/homeassistant/components/xiaomi_miio/binary_sensor.py index 28553c159f..a28c449e5c 100644 --- a/homeassistant/components/xiaomi_miio/binary_sensor.py +++ b/homeassistant/components/xiaomi_miio/binary_sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from dataclasses import dataclass -import logging from typing import Callable from homeassistant.components.binary_sensor import ( @@ -30,9 +29,6 @@ from .const import ( ) from .device import XiaomiCoordinatedMiioEntity -_LOGGER = logging.getLogger(__name__) - - ATTR_NO_WATER = "no_water" ATTR_POWERSUPPLY_ATTACHED = "powersupply_attached" ATTR_WATER_TANK_DETACHED = "water_tank_detached" diff --git a/homeassistant/components/zha/alarm_control_panel.py b/homeassistant/components/zha/alarm_control_panel.py index dd705e4479..1ba5f1b73f 100644 --- a/homeassistant/components/zha/alarm_control_panel.py +++ b/homeassistant/components/zha/alarm_control_panel.py @@ -1,6 +1,5 @@ """Alarm control panels on Zigbee Home Automation networks.""" import functools -import logging from zigpy.zcl.clusters.security import IasAce @@ -44,9 +43,6 @@ from .core.helpers import async_get_zha_config_value from .core.registries import ZHA_ENTITIES from .entity import ZhaEntity -_LOGGER = logging.getLogger(__name__) - - STRICT_MATCH = functools.partial(ZHA_ENTITIES.strict_match, DOMAIN) IAS_ACE_STATE_MAP = { diff --git a/homeassistant/components/zha/core/channels/security.py b/homeassistant/components/zha/core/channels/security.py index 0800fee137..5ef0ee3d9f 100644 --- a/homeassistant/components/zha/core/channels/security.py +++ b/homeassistant/components/zha/core/channels/security.py @@ -7,7 +7,6 @@ https://home-assistant.io/integrations/zha/ from __future__ import annotations import asyncio -import logging from zigpy.exceptions import ZigbeeException from zigpy.zcl.clusters import security @@ -42,8 +41,6 @@ NAME = 0 SIGNAL_ARMED_STATE_CHANGED = "zha_armed_state_changed" SIGNAL_ALARM_TRIGGERED = "zha_armed_triggered" -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(AceCluster.cluster_id) class IasAce(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/registries.py b/homeassistant/components/zha/core/registries.py index 1e41c31383..8b2c4d11fb 100644 --- a/homeassistant/components/zha/core/registries.py +++ b/homeassistant/components/zha/core/registries.py @@ -4,7 +4,6 @@ from __future__ import annotations import collections from collections.abc import Callable import dataclasses -import logging from typing import Dict, List import attr @@ -29,7 +28,6 @@ from . import channels as zha_channels # noqa: F401 pylint: disable=unused-impo from .decorators import CALLABLE_T, DictRegistry, SetRegistry from .typing import ChannelType -_LOGGER = logging.getLogger(__name__) GROUP_ENTITY_DOMAINS = [LIGHT, SWITCH, FAN] PHILLIPS_REMOTE_CLUSTER = 0xFC00 diff --git a/homeassistant/components/zwave_js/triggers/value_updated.py b/homeassistant/components/zwave_js/triggers/value_updated.py index fdf2589073..7ebdb4f374 100644 --- a/homeassistant/components/zwave_js/triggers/value_updated.py +++ b/homeassistant/components/zwave_js/triggers/value_updated.py @@ -2,7 +2,6 @@ from __future__ import annotations import functools -import logging import voluptuous as vol from zwave_js_server.const import CommandClass @@ -39,8 +38,6 @@ from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback from homeassistant.helpers import config_validation as cv, device_registry as dr from homeassistant.helpers.typing import ConfigType -_LOGGER = logging.getLogger(__name__) - # Platform type should be . PLATFORM_TYPE = f"{DOMAIN}.{__name__.rsplit('.', maxsplit=1)[-1]}" diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index 5fb095c4f0..0d966cde31 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -5,7 +5,6 @@ import asyncio from collections.abc import Callable, Coroutine, Iterable from contextvars import ContextVar from datetime import datetime, timedelta -import logging from logging import Logger from types import ModuleType from typing import TYPE_CHECKING, Any, Protocol @@ -59,8 +58,6 @@ PLATFORM_NOT_READY_RETRIES = 10 DATA_ENTITY_PLATFORM = "entity_platform" PLATFORM_NOT_READY_BASE_WAIT_TIME = 30 # seconds -_LOGGER = logging.getLogger(__name__) - class AddEntitiesCallback(Protocol): """Protocol type for EntityPlatform.add_entities callback.""" diff --git a/tests/components/climacell/test_config_flow.py b/tests/components/climacell/test_config_flow.py index faa3748be6..476f2ba3be 100644 --- a/tests/components/climacell/test_config_flow.py +++ b/tests/components/climacell/test_config_flow.py @@ -1,5 +1,4 @@ """Test the ClimaCell config flow.""" -import logging from unittest.mock import patch from pyclimacell.exceptions import ( @@ -34,8 +33,6 @@ from .const import API_KEY, MIN_CONFIG from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - async def test_user_flow_minimum_fields(hass: HomeAssistant) -> None: """Test user config flow with minimum fields.""" diff --git a/tests/components/climacell/test_init.py b/tests/components/climacell/test_init.py index d90a0c0018..5ee50c6d0e 100644 --- a/tests/components/climacell/test_init.py +++ b/tests/components/climacell/test_init.py @@ -1,6 +1,4 @@ """Tests for Climacell init.""" -import logging - import pytest from homeassistant.components.climacell.config_flow import ( @@ -16,8 +14,6 @@ from .const import API_V3_ENTRY_DATA, MIN_CONFIG, V1_ENTRY_DATA from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - async def test_load_and_unload( hass: HomeAssistant, diff --git a/tests/components/climacell/test_sensor.py b/tests/components/climacell/test_sensor.py index c642457b63..8c075942ce 100644 --- a/tests/components/climacell/test_sensor.py +++ b/tests/components/climacell/test_sensor.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging from typing import Any from unittest.mock import patch @@ -23,7 +22,6 @@ from .const import API_V3_ENTRY_DATA, API_V4_ENTRY_DATA from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) CC_SENSOR_ENTITY_ID = "sensor.climacell_{}" O3 = "ozone" diff --git a/tests/components/climacell/test_weather.py b/tests/components/climacell/test_weather.py index 90efdea3c8..e3e15889e4 100644 --- a/tests/components/climacell/test_weather.py +++ b/tests/components/climacell/test_weather.py @@ -2,7 +2,6 @@ from __future__ import annotations from datetime import datetime -import logging from typing import Any from unittest.mock import patch @@ -51,8 +50,6 @@ from .const import API_V3_ENTRY_DATA, API_V4_ENTRY_DATA from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - @callback def _enable_entity(hass: HomeAssistant, entity_name: str) -> None: diff --git a/tests/components/hyperion/test_camera.py b/tests/components/hyperion/test_camera.py index daed1ec2cc..a32663d772 100644 --- a/tests/components/hyperion/test_camera.py +++ b/tests/components/hyperion/test_camera.py @@ -4,7 +4,6 @@ from __future__ import annotations import asyncio import base64 from collections.abc import Awaitable -import logging from typing import Callable from unittest.mock import AsyncMock, Mock, patch @@ -39,7 +38,6 @@ from . import ( setup_test_config_entry, ) -_LOGGER = logging.getLogger(__name__) TEST_CAMERA_ENTITY_ID = "camera.test_instance_1" TEST_IMAGE_DATA = "TEST DATA" TEST_IMAGE_UPDATE = { diff --git a/tests/components/litejet/test_light.py b/tests/components/litejet/test_light.py index 1961843c8b..86b3dd8436 100644 --- a/tests/components/litejet/test_light.py +++ b/tests/components/litejet/test_light.py @@ -1,6 +1,4 @@ """The tests for the litejet component.""" -import logging - from homeassistant.components import light from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_TRANSITION from homeassistant.components.litejet.const import CONF_DEFAULT_TRANSITION @@ -8,8 +6,6 @@ from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_O from . import async_init_integration -_LOGGER = logging.getLogger(__name__) - ENTITY_LIGHT = "light.mock_load_1" ENTITY_LIGHT_NUMBER = 1 ENTITY_OTHER_LIGHT = "light.mock_load_2" diff --git a/tests/components/litejet/test_switch.py b/tests/components/litejet/test_switch.py index dfcb980109..d8fb2ef39c 100644 --- a/tests/components/litejet/test_switch.py +++ b/tests/components/litejet/test_switch.py @@ -1,13 +1,9 @@ """The tests for the litejet component.""" -import logging - from homeassistant.components import switch from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON from . import async_init_integration -_LOGGER = logging.getLogger(__name__) - ENTITY_SWITCH = "switch.mock_switch_1" ENTITY_SWITCH_NUMBER = 1 ENTITY_OTHER_SWITCH = "switch.mock_switch_2" diff --git a/tests/components/modbus/conftest.py b/tests/components/modbus/conftest.py index 9b85d23df1..4c8df13fbe 100644 --- a/tests/components/modbus/conftest.py +++ b/tests/components/modbus/conftest.py @@ -21,8 +21,6 @@ TEST_MODBUS_HOST = "modbusHost" TEST_PORT_TCP = 5501 TEST_PORT_SERIAL = "usb01" -_LOGGER = logging.getLogger(__name__) - @dataclass class ReadResult: diff --git a/tests/components/motioneye/test_config_flow.py b/tests/components/motioneye/test_config_flow.py index dffcc4660d..591bbaa4c7 100644 --- a/tests/components/motioneye/test_config_flow.py +++ b/tests/components/motioneye/test_config_flow.py @@ -1,5 +1,4 @@ """Test the motionEye config flow.""" -import logging from unittest.mock import AsyncMock, patch from motioneye_client.client import ( @@ -25,8 +24,6 @@ from . import TEST_URL, create_mock_motioneye_client, create_mock_motioneye_conf from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - async def test_user_success(hass: HomeAssistant) -> None: """Test successful user flow.""" diff --git a/tests/components/motioneye/test_web_hooks.py b/tests/components/motioneye/test_web_hooks.py index ac84bd405c..55e7e31d9b 100644 --- a/tests/components/motioneye/test_web_hooks.py +++ b/tests/components/motioneye/test_web_hooks.py @@ -1,6 +1,5 @@ """Test the motionEye camera web hooks.""" import copy -import logging from typing import Any from unittest.mock import AsyncMock, call, patch @@ -50,9 +49,6 @@ from . import ( from tests.common import async_capture_events -_LOGGER = logging.getLogger(__name__) - - WEB_HOOK_MOTION_DETECTED_QUERY_STRING = ( "camera_id=%t&changed_pixels=%D&despeckle_labels=%Q&event=%v&fps=%{fps}" "&frame_number=%q&height=%h&host=%{host}&motion_center_x=%K&motion_center_y=%L" diff --git a/tests/components/netgear/test_config_flow.py b/tests/components/netgear/test_config_flow.py index ad060b60d3..b81171196c 100644 --- a/tests/components/netgear/test_config_flow.py +++ b/tests/components/netgear/test_config_flow.py @@ -1,5 +1,4 @@ """Tests for the Netgear config flow.""" -import logging from unittest.mock import Mock, patch from pynetgear import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_USER @@ -19,8 +18,6 @@ from homeassistant.const import ( from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - URL = "http://routerlogin.net" SERIAL = "5ER1AL0000001" diff --git a/tests/components/sia/test_config_flow.py b/tests/components/sia/test_config_flow.py index a91822c784..6b1517601f 100644 --- a/tests/components/sia/test_config_flow.py +++ b/tests/components/sia/test_config_flow.py @@ -1,5 +1,4 @@ """Test the sia config flow.""" -import logging from unittest.mock import patch import pytest @@ -21,9 +20,6 @@ from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - - BASIS_CONFIG_ENTRY_ID = 1 BASIC_CONFIG = { CONF_PORT: 7777,