From dde6305549ed738b232df9627be97accc9e23849 Mon Sep 17 00:00:00 2001 From: Philip Allgaier <mail@spacegaier.de> Date: Sat, 17 Oct 2020 04:24:08 +0200 Subject: [PATCH] Cleanup unused loggers (components N-Z + tests) (#41982) --- .../components/advantage_air/config_flow.py | 4 -- .../arris_tg2492lg/device_tracker.py | 3 -- homeassistant/components/blinkt/light.py | 3 -- homeassistant/components/daikin/sensor.py | 4 -- homeassistant/components/elv/__init__.py | 5 --- .../components/enocean/binary_sensor.py | 4 -- homeassistant/components/familyhub/camera.py | 4 -- .../components/gpslogger/device_tracker.py | 4 -- homeassistant/components/gree/bridge.py | 3 -- .../components/hue/device_trigger.py | 4 -- homeassistant/components/iglo/light.py | 3 -- .../components/islamic_prayer_times/sensor.py | 3 -- .../components/lupusec/binary_sensor.py | 3 -- homeassistant/components/lupusec/switch.py | 3 -- .../components/lutron_caseta/scene.py | 3 -- homeassistant/components/n26/sensor.py | 4 -- homeassistant/components/n26/switch.py | 4 -- homeassistant/components/nad/media_player.py | 4 -- .../components/ness_alarm/__init__.py | 3 -- .../components/ness_alarm/binary_sensor.py | 4 -- homeassistant/components/netatmo/api.py | 3 -- .../components/netatmo/config_flow.py | 2 - .../components/netgear_lte/binary_sensor.py | 4 -- .../components/netgear_lte/sensor.py | 4 -- homeassistant/components/nexia/climate.py | 4 -- .../components/nextcloud/binary_sensor.py | 4 -- homeassistant/components/nextcloud/sensor.py | 4 -- .../components/nightscout/__init__.py | 2 - .../components/notion/binary_sensor.py | 3 -- homeassistant/components/nzbget/__init__.py | 3 -- homeassistant/components/oem/climate.py | 5 --- homeassistant/components/omnilogic/sensor.py | 5 --- .../openalpr_local/image_processing.py | 3 -- homeassistant/components/openerz/sensor.py | 2 - homeassistant/components/opensky/sensor.py | 3 -- .../openweathermap/abstract_owm_sensor.py | 4 -- .../components/openweathermap/config_flow.py | 4 -- .../components/openweathermap/sensor.py | 4 -- .../components/openweathermap/weather.py | 4 -- .../components/opnsense/device_tracker.py | 4 -- homeassistant/components/otp/sensor.py | 3 -- .../components/ovo_energy/config_flow.py | 4 -- homeassistant/components/ovo_energy/sensor.py | 3 -- .../components/owntracks/device_tracker.py | 4 -- homeassistant/components/ozw/binary_sensor.py | 5 --- homeassistant/components/ozw/cover.py | 5 --- .../panasonic_bluray/media_player.py | 3 -- .../components/pcal9535a/binary_sensor.py | 4 -- homeassistant/components/pcal9535a/switch.py | 4 -- .../components/pi4ioe5v9xxxx/binary_sensor.py | 4 -- .../components/pi4ioe5v9xxxx/switch.py | 4 -- .../components/pi_hole/binary_sensor.py | 4 -- homeassistant/components/pi_hole/sensor.py | 3 -- .../components/pilight/base_class.py | 4 -- .../components/pilight/binary_sensor.py | 3 -- homeassistant/components/pilight/light.py | 4 -- homeassistant/components/pilight/switch.py | 4 -- .../components/pjlink/media_player.py | 4 -- homeassistant/components/plugwise/__init__.py | 4 -- .../components/plum_lightpad/light.py | 3 -- .../components/poolsense/binary_sensor.py | 4 -- homeassistant/components/poolsense/sensor.py | 4 -- .../components/powerwall/binary_sensor.py | 4 -- homeassistant/components/profiler/__init__.py | 3 -- .../components/profiler/config_flow.py | 4 -- homeassistant/components/ps4/config_flow.py | 3 -- homeassistant/components/rainbird/switch.py | 5 --- .../components/rainmachine/binary_sensor.py | 4 -- .../components/rainmachine/sensor.py | 4 -- .../components/random/binary_sensor.py | 3 -- homeassistant/components/random/sensor.py | 3 -- homeassistant/components/raspyrfm/switch.py | 4 -- .../components/remote_rpi_gpio/__init__.py | 4 -- .../remote_rpi_gpio/binary_sensor.py | 4 -- .../components/remote_rpi_gpio/switch.py | 4 -- .../components/rest/binary_sensor.py | 4 -- .../components/rflink/binary_sensor.py | 4 -- homeassistant/components/rflink/sensor.py | 4 -- homeassistant/components/rflink/switch.py | 4 -- .../components/rfxtrx/config_flow.py | 3 -- .../components/ring/binary_sensor.py | 3 -- homeassistant/components/ring/sensor.py | 4 -- .../components/roomba/binary_sensor.py | 4 -- .../components/roomba/config_flow.py | 4 -- homeassistant/components/roomba/sensor.py | 4 -- homeassistant/components/roomba/vacuum.py | 4 -- homeassistant/components/roon/__init__.py | 4 -- .../components/rpi_camera/__init__.py | 4 -- homeassistant/components/rpi_gpio/__init__.py | 4 -- .../components/rpi_gpio/binary_sensor.py | 4 -- homeassistant/components/rpi_gpio/cover.py | 3 -- homeassistant/components/rpi_gpio/switch.py | 4 -- homeassistant/components/rpi_pfio/__init__.py | 4 -- .../components/rpi_pfio/binary_sensor.py | 4 -- homeassistant/components/rpi_pfio/switch.py | 4 -- .../components/russound_rio/media_player.py | 4 -- homeassistant/components/sabnzbd/sensor.py | 4 -- .../components/satel_integra/binary_sensor.py | 4 -- homeassistant/components/scene/__init__.py | 5 ++- homeassistant/components/scsgate/cover.py | 2 - homeassistant/components/scsgate/light.py | 2 - homeassistant/components/sense/sensor.py | 4 -- homeassistant/components/sensehat/light.py | 4 -- homeassistant/components/sharkiq/__init__.py | 12 +++--- .../components/sharkiq/config_flow.py | 6 +-- homeassistant/components/sharkiq/const.py | 4 +- .../components/sharkiq/update_coordinator.py | 12 +++--- homeassistant/components/sharkiq/vacuum.py | 4 +- homeassistant/components/shiftr/__init__.py | 4 -- homeassistant/components/simplepush/notify.py | 4 -- .../components/simplisafe/__init__.py | 40 +++++++++---------- .../simplisafe/alarm_control_panel.py | 10 ++--- .../components/simplisafe/config_flow.py | 8 ++-- homeassistant/components/simplisafe/const.py | 2 +- homeassistant/components/simplisafe/lock.py | 6 +-- homeassistant/components/simulated/sensor.py | 3 -- .../components/sisyphus/media_player.py | 4 -- .../components/skybell/binary_sensor.py | 3 -- homeassistant/components/skybell/light.py | 4 -- homeassistant/components/skybell/sensor.py | 3 -- homeassistant/components/skybell/switch.py | 4 -- .../components/smappee/binary_sensor.py | 4 -- .../components/smappee/config_flow.py | 2 - homeassistant/components/smappee/sensor.py | 4 -- homeassistant/components/smappee/switch.py | 4 -- .../components/smart_meter_texas/sensor.py | 4 -- homeassistant/components/smhi/const.py | 4 -- homeassistant/components/sms/__init__.py | 3 -- homeassistant/components/sochain/sensor.py | 3 -- homeassistant/components/solax/sensor.py | 3 -- homeassistant/components/somfy/config_flow.py | 2 - .../components/somfy_mylink/__init__.py | 3 -- homeassistant/components/songpal/__init__.py | 3 -- homeassistant/components/spaceapi/__init__.py | 4 -- .../components/spc/alarm_control_panel.py | 4 -- homeassistant/components/spc/binary_sensor.py | 4 -- homeassistant/components/spider/climate.py | 5 --- homeassistant/components/spider/switch.py | 4 -- homeassistant/components/spotcrime/sensor.py | 3 -- .../components/spotify/config_flow.py | 2 - homeassistant/components/starline/account.py | 8 ++-- .../components/starline/config_flow.py | 6 +-- homeassistant/components/starline/const.py | 2 +- .../components/stookalert/binary_sensor.py | 3 -- homeassistant/components/sun/trigger.py | 3 -- homeassistant/components/switch/light.py | 3 -- homeassistant/components/switchbot/switch.py | 3 -- .../components/switcher_kis/__init__.py | 5 +-- .../components/switcher_kis/switch.py | 4 -- homeassistant/components/switchmate/switch.py | 3 -- homeassistant/components/syslog/notify.py | 3 -- homeassistant/components/tado/entity.py | 5 --- homeassistant/components/tahoma/scene.py | 3 -- .../components/tasmota/binary_sensor.py | 3 -- .../components/tasmota/config_flow.py | 4 -- .../components/tasmota/device_automation.py | 3 -- homeassistant/components/tasmota/light.py | 4 -- homeassistant/components/tasmota/sensor.py | 3 -- homeassistant/components/tasmota/switch.py | 3 -- homeassistant/components/tautulli/sensor.py | 3 -- homeassistant/components/tcp/binary_sensor.py | 4 -- .../components/tellduslive/binary_sensor.py | 4 -- homeassistant/components/tellduslive/cover.py | 4 -- .../components/tellduslive/sensor.py | 4 -- .../components/tellduslive/switch.py | 4 -- homeassistant/components/template/__init__.py | 5 --- .../components/template/binary_sensor.py | 4 -- homeassistant/components/template/lock.py | 4 -- homeassistant/components/template/sensor.py | 3 -- homeassistant/components/template/switch.py | 2 - .../components/tesla/binary_sensor.py | 3 -- .../components/tesla/device_tracker.py | 3 -- homeassistant/components/tesla/sensor.py | 3 -- .../components/thethingsnetwork/__init__.py | 3 -- .../components/thinkingcleaner/sensor.py | 3 -- .../components/thinkingcleaner/switch.py | 3 -- .../components/tibber/config_flow.py | 3 -- homeassistant/components/tof/sensor.py | 3 -- homeassistant/components/toon/__init__.py | 3 -- .../components/toon/binary_sensor.py | 3 -- homeassistant/components/toon/climate.py | 3 -- homeassistant/components/toon/models.py | 3 -- homeassistant/components/toon/oauth2.py | 3 -- homeassistant/components/toon/sensor.py | 3 -- homeassistant/components/toon/switch.py | 3 -- homeassistant/components/torque/sensor.py | 3 -- .../components/totalconnect/config_flow.py | 4 -- homeassistant/components/touchline/climate.py | 4 -- homeassistant/components/traccar/__init__.py | 4 -- homeassistant/components/tradfri/light.py | 4 -- .../components/transmission/sensor.py | 4 -- .../components/transport_nsw/sensor.py | 3 -- .../components/twentemilieu/__init__.py | 3 -- .../components/twentemilieu/config_flow.py | 4 -- .../components/twentemilieu/sensor.py | 3 -- .../components/unifi/device_tracker.py | 3 -- homeassistant/components/unifi/sensor.py | 4 -- homeassistant/components/unifi/switch.py | 4 +- .../components/unifi/unifi_client.py | 5 --- .../components/unifi/unifi_entity_base.py | 10 +++-- .../components/universal/media_player.py | 3 -- .../components/velbus/binary_sensor.py | 4 -- homeassistant/components/velbus/sensor.py | 4 -- .../components/vera/binary_sensor.py | 3 -- homeassistant/components/vera/climate.py | 3 -- homeassistant/components/vera/common.py | 3 -- homeassistant/components/vera/cover.py | 3 -- homeassistant/components/vera/light.py | 3 -- homeassistant/components/vera/lock.py | 3 -- homeassistant/components/vera/scene.py | 3 -- homeassistant/components/vera/sensor.py | 3 -- homeassistant/components/vera/switch.py | 3 -- .../components/verisure/binary_sensor.py | 4 -- homeassistant/components/verisure/sensor.py | 4 -- homeassistant/components/verisure/switch.py | 3 -- homeassistant/components/version/sensor.py | 3 -- .../components/vesync/config_flow.py | 3 -- homeassistant/components/vivotek/camera.py | 5 --- .../components/volumio/media_player.py | 2 - .../components/volvooncall/binary_sensor.py | 4 -- .../components/volvooncall/device_tracker.py | 4 -- homeassistant/components/volvooncall/lock.py | 4 -- .../components/volvooncall/sensor.py | 4 -- .../components/volvooncall/switch.py | 4 -- homeassistant/components/watson_tts/tts.py | 4 -- homeassistant/components/webhook/trigger.py | 3 -- .../components/websocket_api/commands.py | 3 -- .../components/websocket_api/decorators.py | 3 -- .../components/wilight/config_flow.py | 3 -- .../components/wink/alarm_control_panel.py | 4 -- homeassistant/components/wink/fan.py | 4 -- homeassistant/components/wink/lock.py | 4 -- homeassistant/components/wink/scene.py | 3 -- homeassistant/components/wink/switch.py | 4 -- .../components/wirelesstag/binary_sensor.py | 4 -- .../components/wirelesstag/switch.py | 4 -- .../components/withings/config_flow.py | 2 - homeassistant/components/wled/config_flow.py | 3 -- homeassistant/components/wled/light.py | 3 -- homeassistant/components/wled/sensor.py | 3 -- homeassistant/components/wled/switch.py | 3 -- homeassistant/components/wolflink/sensor.py | 4 -- homeassistant/components/worldclock/sensor.py | 4 -- homeassistant/components/xbox/config_flow.py | 2 - homeassistant/components/xbox/media_player.py | 3 -- homeassistant/components/xbox/media_source.py | 3 -- .../components/xiaomi_aqara/cover.py | 4 -- homeassistant/components/xiaomi_aqara/lock.py | 4 -- .../components/xiaomi_miio/__init__.py | 4 -- homeassistant/components/xs1/climate.py | 4 -- homeassistant/components/xs1/sensor.py | 4 -- homeassistant/components/xs1/switch.py | 3 -- homeassistant/components/zha/climate.py | 3 -- .../components/zha/core/channels/__init__.py | 2 - .../components/zha/core/channels/closures.py | 4 -- .../components/zha/core/channels/general.py | 3 -- .../zha/core/channels/homeautomation.py | 3 -- .../components/zha/core/channels/hvac.py | 3 -- .../components/zha/core/channels/lighting.py | 4 -- .../components/zha/core/channels/lightlink.py | 4 -- .../zha/core/channels/manufacturerspecific.py | 4 -- .../zha/core/channels/measurement.py | 4 -- .../components/zha/core/channels/protocol.py | 4 -- .../components/zha/core/channels/security.py | 3 -- .../zha/core/channels/smartenergy.py | 4 -- homeassistant/components/zha/core/helpers.py | 2 - homeassistant/components/zha/core/store.py | 3 -- .../components/zha/device_tracker.py | 2 - homeassistant/components/zha/fan.py | 3 -- homeassistant/components/zha/lock.py | 6 +-- homeassistant/components/zha/sensor.py | 2 - homeassistant/components/zha/switch.py | 2 - homeassistant/components/zodiac/sensor.py | 4 -- homeassistant/components/zwave/config_flow.py | 3 -- homeassistant/components/zwave/fan.py | 3 -- homeassistant/components/zwave/node_entity.py | 3 -- homeassistant/components/zwave/sensor.py | 4 -- homeassistant/components/zwave/switch.py | 3 -- .../components/zwave/websocket_api.py | 5 --- homeassistant/helpers/aiohttp_client.py | 3 -- homeassistant/helpers/area_registry.py | 3 -- homeassistant/helpers/json.py | 3 -- homeassistant/util/distance.py | 4 -- homeassistant/util/pressure.py | 4 -- homeassistant/util/timeout.py | 3 -- homeassistant/util/unit_system.py | 4 -- homeassistant/util/volume.py | 4 -- script/hassfest/translations.py | 3 -- .../integration/config_flow.py | 2 - tests/components/bond/test_cover.py | 3 -- tests/components/bond/test_light.py | 3 -- tests/components/bond/test_switch.py | 3 -- .../components/google_assistant/test_trait.py | 3 -- tests/components/hue/test_light.py | 3 -- tests/components/hue/test_sensor_base.py | 3 -- tests/components/insteon/mock_devices.py | 4 -- tests/components/insteon/test_init.py | 3 -- tests/components/logbook/test_init.py | 3 -- tests/components/mobile_app/test_entity.py | 5 --- tests/components/mobile_app/test_webhook.py | 4 -- tests/components/modbus/conftest.py | 3 -- .../modbus/test_modbus_binary_sensor.py | 3 -- tests/components/modbus/test_modbus_sensor.py | 3 -- tests/components/modbus/test_modbus_switch.py | 3 -- .../mqtt_json/test_device_tracker.py | 2 - tests/components/qwikswitch/test_init.py | 3 -- .../components/remember_the_milk/test_init.py | 5 --- tests/components/rflink/test_cover.py | 5 --- tests/components/sma/test_sensor.py | 3 -- tests/components/stream/common.py | 3 -- tests/components/tag/test_init.py | 4 -- .../template/test_alarm_control_panel.py | 4 -- tests/components/template/test_cover.py | 4 -- tests/components/template/test_fan.py | 5 --- tests/components/template/test_lock.py | 4 -- tests/components/template/test_vacuum.py | 4 -- tests/components/utility_meter/test_init.py | 3 -- tests/components/utility_meter/test_sensor.py | 3 -- tests/components/vizio/const.py | 4 -- tests/components/vizio/test_config_flow.py | 4 -- tests/components/vizio/test_media_player.py | 3 -- tests/components/zha/test_gateway.py | 2 - tests/helpers/test_collection.py | 16 ++++---- tests/helpers/test_update_coordinator.py | 4 +- tests/test_bootstrap.py | 3 -- tests/test_setup.py | 3 -- 326 files changed, 84 insertions(+), 1156 deletions(-) diff --git a/homeassistant/components/advantage_air/config_flow.py b/homeassistant/components/advantage_air/config_flow.py index 7c2f5e11f53..39c6e9efd4e 100644 --- a/homeassistant/components/advantage_air/config_flow.py +++ b/homeassistant/components/advantage_air/config_flow.py @@ -1,6 +1,4 @@ """Config Flow for Advantage Air integration.""" -import logging - from advantage_air import ApiError, advantage_air import voluptuous as vol @@ -19,8 +17,6 @@ ADVANTAGE_AIR_SCHEMA = vol.Schema( } ) -_LOGGER = logging.getLogger(__name__) - class AdvantageAirConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Config Advantage Air API connection.""" diff --git a/homeassistant/components/arris_tg2492lg/device_tracker.py b/homeassistant/components/arris_tg2492lg/device_tracker.py index d18d19806f9..e63bef9c108 100644 --- a/homeassistant/components/arris_tg2492lg/device_tracker.py +++ b/homeassistant/components/arris_tg2492lg/device_tracker.py @@ -1,5 +1,4 @@ """Support for Arris TG2492LG router.""" -import logging from typing import List from arris_tg2492lg import ConnectBox, Device @@ -13,8 +12,6 @@ from homeassistant.components.device_tracker import ( from homeassistant.const import CONF_HOST, CONF_PASSWORD import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DEFAULT_HOST = "192.168.178.1" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/blinkt/light.py b/homeassistant/components/blinkt/light.py index 768ca92d9d2..0d1aff7b826 100644 --- a/homeassistant/components/blinkt/light.py +++ b/homeassistant/components/blinkt/light.py @@ -1,6 +1,5 @@ """Support for Blinkt! lights on Raspberry Pi.""" import importlib -import logging import voluptuous as vol @@ -16,8 +15,6 @@ from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv import homeassistant.util.color as color_util -_LOGGER = logging.getLogger(__name__) - SUPPORT_BLINKT = SUPPORT_BRIGHTNESS | SUPPORT_COLOR DEFAULT_NAME = "blinkt" diff --git a/homeassistant/components/daikin/sensor.py b/homeassistant/components/daikin/sensor.py index 73cadba9e45..80de4ed34a5 100644 --- a/homeassistant/components/daikin/sensor.py +++ b/homeassistant/components/daikin/sensor.py @@ -1,6 +1,4 @@ """Support for Daikin AC sensors.""" -import logging - from homeassistant.const import ( CONF_DEVICE_CLASS, CONF_ICON, @@ -26,8 +24,6 @@ from .const import ( SENSOR_TYPES, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Old way of setting up the Daikin sensors. diff --git a/homeassistant/components/elv/__init__.py b/homeassistant/components/elv/__init__.py index b776c7f5453..a3153eee1e4 100644 --- a/homeassistant/components/elv/__init__.py +++ b/homeassistant/components/elv/__init__.py @@ -1,15 +1,10 @@ """The Elv integration.""" - -import logging - import voluptuous as vol from homeassistant.const import CONF_DEVICE from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DOMAIN = "elv" DEFAULT_DEVICE = "/dev/ttyUSB0" diff --git a/homeassistant/components/enocean/binary_sensor.py b/homeassistant/components/enocean/binary_sensor.py index 31bd6607ae2..cc58103b7ef 100644 --- a/homeassistant/components/enocean/binary_sensor.py +++ b/homeassistant/components/enocean/binary_sensor.py @@ -1,6 +1,4 @@ """Support for EnOcean binary sensors.""" -import logging - import voluptuous as vol from homeassistant.components.binary_sensor import ( @@ -13,8 +11,6 @@ import homeassistant.helpers.config_validation as cv from .device import EnOceanEntity -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "EnOcean binary sensor" DEPENDENCIES = ["enocean"] EVENT_BUTTON_PRESSED = "button_pressed" diff --git a/homeassistant/components/familyhub/camera.py b/homeassistant/components/familyhub/camera.py index 2e4e7085927..ea654074a5a 100644 --- a/homeassistant/components/familyhub/camera.py +++ b/homeassistant/components/familyhub/camera.py @@ -1,6 +1,4 @@ """Family Hub camera for Samsung Refrigerators.""" -import logging - from pyfamilyhublocal import FamilyHubCam import voluptuous as vol @@ -9,8 +7,6 @@ from homeassistant.const import CONF_IP_ADDRESS, CONF_NAME from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "FamilyHub Camera" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/gpslogger/device_tracker.py b/homeassistant/components/gpslogger/device_tracker.py index d294b07ebc7..6999f26d752 100644 --- a/homeassistant/components/gpslogger/device_tracker.py +++ b/homeassistant/components/gpslogger/device_tracker.py @@ -1,6 +1,4 @@ """Support for the GPSLogger device tracking.""" -import logging - from homeassistant.components.device_tracker import SOURCE_TYPE_GPS from homeassistant.components.device_tracker.config_entry import TrackerEntity from homeassistant.const import ( @@ -24,8 +22,6 @@ from .const import ( ATTR_SPEED, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass: HomeAssistantType, entry, async_add_entities): """Configure a dispatcher connection based on a config entry.""" diff --git a/homeassistant/components/gree/bridge.py b/homeassistant/components/gree/bridge.py index 6c02126e678..44adaf970b8 100644 --- a/homeassistant/components/gree/bridge.py +++ b/homeassistant/components/gree/bridge.py @@ -1,5 +1,4 @@ """Helper and wrapper classes for Gree module.""" -import logging from typing import List from greeclimate.device import Device, DeviceInfo @@ -8,8 +7,6 @@ from greeclimate.exceptions import DeviceNotBoundError from homeassistant import exceptions -_LOGGER = logging.getLogger(__name__) - class DeviceHelper: """Device search and bind wrapper for Gree platform.""" diff --git a/homeassistant/components/hue/device_trigger.py b/homeassistant/components/hue/device_trigger.py index 9e56a253a58..c3dc18cd5df 100644 --- a/homeassistant/components/hue/device_trigger.py +++ b/homeassistant/components/hue/device_trigger.py @@ -1,6 +1,4 @@ """Provides device automations for Philips Hue events.""" -import logging - import voluptuous as vol from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA @@ -20,8 +18,6 @@ from homeassistant.const import ( from . import DOMAIN from .hue_event import CONF_HUE_EVENT -_LOGGER = logging.getLogger(__file__) - CONF_SUBTYPE = "subtype" CONF_SHORT_PRESS = "remote_button_short_press" diff --git a/homeassistant/components/iglo/light.py b/homeassistant/components/iglo/light.py index f6f681d8b60..dbabc3261b5 100644 --- a/homeassistant/components/iglo/light.py +++ b/homeassistant/components/iglo/light.py @@ -1,5 +1,4 @@ """Support for lights under the iGlo brand.""" -import logging import math from iglo import Lamp @@ -21,8 +20,6 @@ from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT import homeassistant.helpers.config_validation as cv import homeassistant.util.color as color_util -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "iGlo Light" DEFAULT_PORT = 8080 diff --git a/homeassistant/components/islamic_prayer_times/sensor.py b/homeassistant/components/islamic_prayer_times/sensor.py index e0c2cf16f68..41b3cf4c667 100644 --- a/homeassistant/components/islamic_prayer_times/sensor.py +++ b/homeassistant/components/islamic_prayer_times/sensor.py @@ -1,5 +1,4 @@ """Platform to retrieve Islamic prayer times information for Home Assistant.""" -import logging from homeassistant.const import DEVICE_CLASS_TIMESTAMP from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -8,8 +7,6 @@ import homeassistant.util.dt as dt_util from .const import DATA_UPDATED, DOMAIN, PRAYER_TIMES_ICON, SENSOR_TYPES -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Islamic prayer times sensor platform.""" diff --git a/homeassistant/components/lupusec/binary_sensor.py b/homeassistant/components/lupusec/binary_sensor.py index 30af5743aa0..963c82da5fa 100644 --- a/homeassistant/components/lupusec/binary_sensor.py +++ b/homeassistant/components/lupusec/binary_sensor.py @@ -1,6 +1,5 @@ """Support for Lupusec Security System binary sensors.""" from datetime import timedelta -import logging import lupupy.constants as CONST @@ -10,8 +9,6 @@ from . import DOMAIN as LUPUSEC_DOMAIN, LupusecDevice SCAN_INTERVAL = timedelta(seconds=2) -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up a sensor for an Lupusec device.""" diff --git a/homeassistant/components/lupusec/switch.py b/homeassistant/components/lupusec/switch.py index d18fcd7c1f7..f35322eb773 100644 --- a/homeassistant/components/lupusec/switch.py +++ b/homeassistant/components/lupusec/switch.py @@ -1,6 +1,5 @@ """Support for Lupusec Security System switches.""" from datetime import timedelta -import logging import lupupy.constants as CONST @@ -10,8 +9,6 @@ from . import DOMAIN as LUPUSEC_DOMAIN, LupusecDevice SCAN_INTERVAL = timedelta(seconds=2) -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up Lupusec switch devices.""" diff --git a/homeassistant/components/lutron_caseta/scene.py b/homeassistant/components/lutron_caseta/scene.py index a69f4594d14..51dff935d93 100644 --- a/homeassistant/components/lutron_caseta/scene.py +++ b/homeassistant/components/lutron_caseta/scene.py @@ -1,13 +1,10 @@ """Support for Lutron Caseta scenes.""" -import logging from typing import Any from homeassistant.components.scene import Scene from . import DOMAIN as CASETA_DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Lutron Caseta scene platform. diff --git a/homeassistant/components/n26/sensor.py b/homeassistant/components/n26/sensor.py index 7752efe82ea..b9a8b21f9d0 100644 --- a/homeassistant/components/n26/sensor.py +++ b/homeassistant/components/n26/sensor.py @@ -1,13 +1,9 @@ """Support for N26 bank account sensors.""" -import logging - from homeassistant.helpers.entity import Entity from . import DEFAULT_SCAN_INTERVAL, DOMAIN, timestamp_ms_to_date from .const import DATA -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = DEFAULT_SCAN_INTERVAL ATTR_IBAN = "account" diff --git a/homeassistant/components/n26/switch.py b/homeassistant/components/n26/switch.py index 155c9c0091b..910aa96ca49 100644 --- a/homeassistant/components/n26/switch.py +++ b/homeassistant/components/n26/switch.py @@ -1,13 +1,9 @@ """Support for N26 switches.""" -import logging - from homeassistant.components.switch import SwitchEntity from . import DEFAULT_SCAN_INTERVAL, DOMAIN from .const import CARD_STATE_ACTIVE, CARD_STATE_BLOCKED, DATA -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = DEFAULT_SCAN_INTERVAL diff --git a/homeassistant/components/nad/media_player.py b/homeassistant/components/nad/media_player.py index a98e4eafe2d..7d8537db6c6 100644 --- a/homeassistant/components/nad/media_player.py +++ b/homeassistant/components/nad/media_player.py @@ -1,6 +1,4 @@ """Support for interfacing with NAD receivers through RS-232.""" -import logging - from nad_receiver import NADReceiver, NADReceiverTCP, NADReceiverTelnet import voluptuous as vol @@ -16,8 +14,6 @@ from homeassistant.components.media_player.const import ( from homeassistant.const import CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DEFAULT_TYPE = "RS232" DEFAULT_SERIAL_PORT = "/dev/ttyUSB0" DEFAULT_PORT = 53 diff --git a/homeassistant/components/ness_alarm/__init__.py b/homeassistant/components/ness_alarm/__init__.py index 7e5df865aa0..e17e63ee46c 100644 --- a/homeassistant/components/ness_alarm/__init__.py +++ b/homeassistant/components/ness_alarm/__init__.py @@ -1,7 +1,6 @@ """Support for Ness D8X/D16X devices.""" from collections import namedtuple import datetime -import logging from nessclient import ArmingState, Client import voluptuous as vol @@ -18,8 +17,6 @@ from homeassistant.helpers import config_validation as cv from homeassistant.helpers.discovery import async_load_platform from homeassistant.helpers.dispatcher import async_dispatcher_send -_LOGGER = logging.getLogger(__name__) - DOMAIN = "ness_alarm" DATA_NESS = "ness_alarm" diff --git a/homeassistant/components/ness_alarm/binary_sensor.py b/homeassistant/components/ness_alarm/binary_sensor.py index d7e7851792e..ebe5face235 100644 --- a/homeassistant/components/ness_alarm/binary_sensor.py +++ b/homeassistant/components/ness_alarm/binary_sensor.py @@ -1,6 +1,4 @@ """Support for Ness D8X/D16X zone states - represented as binary sensors.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -14,8 +12,6 @@ from . import ( ZoneChangedData, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Ness Alarm binary sensor devices.""" diff --git a/homeassistant/components/netatmo/api.py b/homeassistant/components/netatmo/api.py index 6c5aee818d5..c13a0b899c7 100644 --- a/homeassistant/components/netatmo/api.py +++ b/homeassistant/components/netatmo/api.py @@ -1,14 +1,11 @@ """API for Netatmo bound to HASS OAuth.""" from asyncio import run_coroutine_threadsafe -import logging import pyatmo from homeassistant import config_entries, core from homeassistant.helpers import config_entry_oauth2_flow -_LOGGER = logging.getLogger(__name__) - class ConfigEntryNetatmoAuth(pyatmo.auth.NetatmoOAuth2): """Provide Netatmo authentication tied to an OAuth2 based config entry.""" diff --git a/homeassistant/components/netatmo/config_flow.py b/homeassistant/components/netatmo/config_flow.py index 6ae1fd864df..6217ef1a0e6 100644 --- a/homeassistant/components/netatmo/config_flow.py +++ b/homeassistant/components/netatmo/config_flow.py @@ -22,8 +22,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - class NetatmoFlowHandler( config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN diff --git a/homeassistant/components/netgear_lte/binary_sensor.py b/homeassistant/components/netgear_lte/binary_sensor.py index f18c7a2ff86..e18c63ff5c0 100644 --- a/homeassistant/components/netgear_lte/binary_sensor.py +++ b/homeassistant/components/netgear_lte/binary_sensor.py @@ -1,14 +1,10 @@ """Support for Netgear LTE binary sensors.""" -import logging - from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity from homeassistant.exceptions import PlatformNotReady from . import CONF_MONITORED_CONDITIONS, DATA_KEY, LTEEntity from .sensor_types import BINARY_SENSOR_CLASSES -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info): """Set up Netgear LTE binary sensor devices.""" diff --git a/homeassistant/components/netgear_lte/sensor.py b/homeassistant/components/netgear_lte/sensor.py index 49301a61e4f..abbedf79d64 100644 --- a/homeassistant/components/netgear_lte/sensor.py +++ b/homeassistant/components/netgear_lte/sensor.py @@ -1,14 +1,10 @@ """Support for Netgear LTE sensors.""" -import logging - from homeassistant.components.sensor import DOMAIN from homeassistant.exceptions import PlatformNotReady from . import CONF_MONITORED_CONDITIONS, DATA_KEY, LTEEntity from .sensor_types import SENSOR_SMS, SENSOR_SMS_TOTAL, SENSOR_UNITS, SENSOR_USAGE -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info): """Set up Netgear LTE sensor devices.""" diff --git a/homeassistant/components/nexia/climate.py b/homeassistant/components/nexia/climate.py index 5085242e6d7..2b3f7de4489 100644 --- a/homeassistant/components/nexia/climate.py +++ b/homeassistant/components/nexia/climate.py @@ -1,6 +1,4 @@ """Support for Nexia / Trane XL thermostats.""" -import logging - from nexia.const import ( OPERATION_MODE_AUTO, OPERATION_MODE_COOL, @@ -82,8 +80,6 @@ SET_HUMIDITY_SCHEMA = vol.Schema( ) -_LOGGER = logging.getLogger(__name__) - # # Nexia has two bits to determine hvac mode # There are actually eight states so we map to diff --git a/homeassistant/components/nextcloud/binary_sensor.py b/homeassistant/components/nextcloud/binary_sensor.py index 67bc580bfdf..c1f1dbf3076 100644 --- a/homeassistant/components/nextcloud/binary_sensor.py +++ b/homeassistant/components/nextcloud/binary_sensor.py @@ -1,12 +1,8 @@ """Summary binary data from Nextcoud.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from . import BINARY_SENSORS, DOMAIN -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Nextcloud sensors.""" diff --git a/homeassistant/components/nextcloud/sensor.py b/homeassistant/components/nextcloud/sensor.py index aacd33ec3e8..e0be9dde69e 100644 --- a/homeassistant/components/nextcloud/sensor.py +++ b/homeassistant/components/nextcloud/sensor.py @@ -1,12 +1,8 @@ """Summary data from Nextcoud.""" -import logging - from homeassistant.helpers.entity import Entity from . import DOMAIN, SENSORS -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Nextcloud sensors.""" diff --git a/homeassistant/components/nightscout/__init__.py b/homeassistant/components/nightscout/__init__.py index 1b67963bcc3..4c8ab756ddf 100644 --- a/homeassistant/components/nightscout/__init__.py +++ b/homeassistant/components/nightscout/__init__.py @@ -1,7 +1,6 @@ """The Nightscout integration.""" import asyncio from asyncio import TimeoutError as AsyncIOTimeoutError -import logging from aiohttp import ClientError from py_nightscout import Api as NightscoutAPI @@ -16,7 +15,6 @@ from homeassistant.helpers.entity import SLOW_UPDATE_WARNING from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) PLATFORMS = ["sensor"] _API_TIMEOUT = SLOW_UPDATE_WARNING - 1 diff --git a/homeassistant/components/notion/binary_sensor.py b/homeassistant/components/notion/binary_sensor.py index 3702688eb94..1597957c1f5 100644 --- a/homeassistant/components/notion/binary_sensor.py +++ b/homeassistant/components/notion/binary_sensor.py @@ -1,5 +1,4 @@ """Support for Notion binary sensors.""" -import logging from typing import Callable from homeassistant.components.binary_sensor import ( @@ -29,8 +28,6 @@ from .const import ( SENSOR_WINDOW_HINGED_VERTICAL, ) -_LOGGER = logging.getLogger(__name__) - BINARY_SENSOR_TYPES = { SENSOR_BATTERY: ("Low Battery", "battery"), SENSOR_DOOR: ("Door", DEVICE_CLASS_DOOR), diff --git a/homeassistant/components/nzbget/__init__.py b/homeassistant/components/nzbget/__init__.py index 467cd8c06db..eba5eb58baf 100644 --- a/homeassistant/components/nzbget/__init__.py +++ b/homeassistant/components/nzbget/__init__.py @@ -1,6 +1,5 @@ """The NZBGet integration.""" import asyncio -import logging import voluptuous as vol @@ -35,8 +34,6 @@ from .const import ( ) from .coordinator import NZBGetDataUpdateCoordinator -_LOGGER = logging.getLogger(__name__) - PLATFORMS = ["sensor", "switch"] CONFIG_SCHEMA = vol.Schema( diff --git a/homeassistant/components/oem/climate.py b/homeassistant/components/oem/climate.py index 734fe12d0f5..49badaeb7b6 100644 --- a/homeassistant/components/oem/climate.py +++ b/homeassistant/components/oem/climate.py @@ -1,6 +1,4 @@ """OpenEnergyMonitor Thermostat Support.""" -import logging - from oemthermostat import Thermostat import requests import voluptuous as vol @@ -26,9 +24,6 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_HOST): cv.string, diff --git a/homeassistant/components/omnilogic/sensor.py b/homeassistant/components/omnilogic/sensor.py index deaee33ed82..e1b4b387a46 100644 --- a/homeassistant/components/omnilogic/sensor.py +++ b/homeassistant/components/omnilogic/sensor.py @@ -1,7 +1,4 @@ """Definition and setup of the Omnilogic Sensors for Home Assistant.""" - -import logging - from homeassistant.components.sensor import DEVICE_CLASS_TEMPERATURE from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, @@ -15,8 +12,6 @@ from homeassistant.const import ( from .common import OmniLogicEntity, OmniLogicUpdateCoordinator from .const import COORDINATOR, DOMAIN, PUMP_TYPES -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up the sensor platform.""" diff --git a/homeassistant/components/openalpr_local/image_processing.py b/homeassistant/components/openalpr_local/image_processing.py index 644f2c687b2..ee913070a11 100644 --- a/homeassistant/components/openalpr_local/image_processing.py +++ b/homeassistant/components/openalpr_local/image_processing.py @@ -1,7 +1,6 @@ """Component that will help set the OpenALPR local for ALPR processing.""" import asyncio import io -import logging import re import voluptuous as vol @@ -21,8 +20,6 @@ from homeassistant.core import callback, split_entity_id import homeassistant.helpers.config_validation as cv from homeassistant.util.async_ import run_callback_threadsafe -_LOGGER = logging.getLogger(__name__) - RE_ALPR_PLATE = re.compile(r"^plate\d*:") RE_ALPR_RESULT = re.compile(r"- (\w*)\s*confidence: (\d*.\d*)") diff --git a/homeassistant/components/openerz/sensor.py b/homeassistant/components/openerz/sensor.py index 6e72058b60b..9a5bf3a9813 100644 --- a/homeassistant/components/openerz/sensor.py +++ b/homeassistant/components/openerz/sensor.py @@ -1,6 +1,5 @@ """Support for OpenERZ API for Zurich city waste disposal system.""" from datetime import timedelta -import logging from openerz_api.main import OpenERZConnector import voluptuous as vol @@ -9,7 +8,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.config_validation import PLATFORM_SCHEMA from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) SCAN_INTERVAL = timedelta(hours=12) CONF_ZIP = "zip" diff --git a/homeassistant/components/opensky/sensor.py b/homeassistant/components/opensky/sensor.py index d916d9f7f29..49edf8e7d0a 100644 --- a/homeassistant/components/opensky/sensor.py +++ b/homeassistant/components/opensky/sensor.py @@ -1,6 +1,5 @@ """Sensor for the Open Sky Network.""" from datetime import timedelta -import logging import requests import voluptuous as vol @@ -21,8 +20,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import distance as util_distance, location as util_location -_LOGGER = logging.getLogger(__name__) - CONF_ALTITUDE = "altitude" ATTR_CALLSIGN = "callsign" diff --git a/homeassistant/components/openweathermap/abstract_owm_sensor.py b/homeassistant/components/openweathermap/abstract_owm_sensor.py index 7378324b0a4..809d2c2e572 100644 --- a/homeassistant/components/openweathermap/abstract_owm_sensor.py +++ b/homeassistant/components/openweathermap/abstract_owm_sensor.py @@ -1,14 +1,10 @@ """Abstraction form OWM sensors.""" -import logging - from homeassistant.const import ATTR_ATTRIBUTION from homeassistant.helpers.entity import Entity from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT -_LOGGER = logging.getLogger(__name__) - class AbstractOpenWeatherMapSensor(Entity): """Abstract class for an OpenWeatherMap sensor.""" diff --git a/homeassistant/components/openweathermap/config_flow.py b/homeassistant/components/openweathermap/config_flow.py index 1a50b035db8..f383a5cb123 100644 --- a/homeassistant/components/openweathermap/config_flow.py +++ b/homeassistant/components/openweathermap/config_flow.py @@ -1,6 +1,4 @@ """Config flow for OpenWeatherMap.""" -import logging - from pyowm import OWM from pyowm.exceptions.api_call_error import APICallError from pyowm.exceptions.api_response_error import UnauthorizedError @@ -38,8 +36,6 @@ SCHEMA = vol.Schema( } ) -_LOGGER = logging.getLogger(__name__) - class OpenWeatherMapConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Config flow for OpenWeatherMap.""" diff --git a/homeassistant/components/openweathermap/sensor.py b/homeassistant/components/openweathermap/sensor.py index c6363107d45..3879d270b52 100644 --- a/homeassistant/components/openweathermap/sensor.py +++ b/homeassistant/components/openweathermap/sensor.py @@ -1,6 +1,4 @@ """Support for the OpenWeatherMap (OWM) service.""" -import logging - from .abstract_owm_sensor import AbstractOpenWeatherMapSensor from .const import ( ATTR_API_THIS_DAY_FORECAST, @@ -16,8 +14,6 @@ from .const import ( from .forecast_update_coordinator import ForecastUpdateCoordinator from .weather_update_coordinator import WeatherUpdateCoordinator -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up OpenWeatherMap sensor entities based on a config entry.""" diff --git a/homeassistant/components/openweathermap/weather.py b/homeassistant/components/openweathermap/weather.py index cde7eb96732..e1ec96e5d07 100644 --- a/homeassistant/components/openweathermap/weather.py +++ b/homeassistant/components/openweathermap/weather.py @@ -1,6 +1,4 @@ """Support for the OpenWeatherMap (OWM) service.""" -import logging - from homeassistant.components.weather import WeatherEntity from homeassistant.const import TEMP_CELSIUS @@ -21,8 +19,6 @@ from .const import ( from .forecast_update_coordinator import ForecastUpdateCoordinator from .weather_update_coordinator import WeatherUpdateCoordinator -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up OpenWeatherMap weather entity based on a config entry.""" diff --git a/homeassistant/components/opnsense/device_tracker.py b/homeassistant/components/opnsense/device_tracker.py index f7743d04a6d..936872f7a86 100644 --- a/homeassistant/components/opnsense/device_tracker.py +++ b/homeassistant/components/opnsense/device_tracker.py @@ -1,11 +1,7 @@ """Device tracker support for OPNSense routers.""" -import logging - from homeassistant.components.device_tracker import DeviceScanner from homeassistant.components.opnsense import CONF_TRACKER_INTERFACE, OPNSENSE_DATA -_LOGGER = logging.getLogger(__name__) - async def async_get_scanner(hass, config, discovery_info=None): """Configure the OPNSense device_tracker.""" diff --git a/homeassistant/components/otp/sensor.py b/homeassistant/components/otp/sensor.py index df5f6af1695..9f23f5ae6fa 100644 --- a/homeassistant/components/otp/sensor.py +++ b/homeassistant/components/otp/sensor.py @@ -1,5 +1,4 @@ """Support for One-Time Password (OTP).""" -import logging import time import pyotp @@ -11,8 +10,6 @@ from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "OTP Sensor" TIME_STEP = 30 # Default time step assumed by Google Authenticator diff --git a/homeassistant/components/ovo_energy/config_flow.py b/homeassistant/components/ovo_energy/config_flow.py index d9048affd04..dfedf780592 100644 --- a/homeassistant/components/ovo_energy/config_flow.py +++ b/homeassistant/components/ovo_energy/config_flow.py @@ -1,6 +1,4 @@ """Config flow to configure the OVO Energy integration.""" -import logging - import aiohttp from ovoenergy.ovoenergy import OVOEnergy import voluptuous as vol @@ -11,8 +9,6 @@ from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from .const import CONF_ACCOUNT_ID, DOMAIN # pylint: disable=unused-import -_LOGGER = logging.getLogger(__name__) - USER_SCHEMA = vol.Schema( {vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str} ) diff --git a/homeassistant/components/ovo_energy/sensor.py b/homeassistant/components/ovo_energy/sensor.py index c43b7ec8514..2a64fbe2d22 100644 --- a/homeassistant/components/ovo_energy/sensor.py +++ b/homeassistant/components/ovo_energy/sensor.py @@ -1,6 +1,5 @@ """Support for OVO Energy sensors.""" from datetime import timedelta -import logging from ovoenergy import OVODailyUsage from ovoenergy.ovoenergy import OVOEnergy @@ -12,8 +11,6 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from . import OVOEnergyDeviceEntity from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = timedelta(seconds=300) PARALLEL_UPDATES = 4 diff --git a/homeassistant/components/owntracks/device_tracker.py b/homeassistant/components/owntracks/device_tracker.py index d4a5399a0ff..8a8fdc52fb1 100644 --- a/homeassistant/components/owntracks/device_tracker.py +++ b/homeassistant/components/owntracks/device_tracker.py @@ -1,6 +1,4 @@ """Device tracker platform that adds support for OwnTracks over MQTT.""" -import logging - from homeassistant.components.device_tracker.config_entry import TrackerEntity from homeassistant.components.device_tracker.const import ( ATTR_SOURCE_TYPE, @@ -19,8 +17,6 @@ from homeassistant.helpers.restore_state import RestoreEntity from . import DOMAIN as OT_DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up OwnTracks based off an entry.""" diff --git a/homeassistant/components/ozw/binary_sensor.py b/homeassistant/components/ozw/binary_sensor.py index 64fd66394f8..91b26218c97 100644 --- a/homeassistant/components/ozw/binary_sensor.py +++ b/homeassistant/components/ozw/binary_sensor.py @@ -1,7 +1,4 @@ """Representation of Z-Wave binary_sensors.""" - -import logging - from openzwavemqtt.const import CommandClass, ValueIndex, ValueType from homeassistant.components.binary_sensor import ( @@ -25,8 +22,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from .const import DATA_UNSUBSCRIBE, DOMAIN from .entity import ZWaveDeviceEntity -_LOGGER = logging.getLogger(__name__) - NOTIFICATION_TYPE = "index" NOTIFICATION_VALUES = "values" NOTIFICATION_DEVICE_CLASS = "device_class" diff --git a/homeassistant/components/ozw/cover.py b/homeassistant/components/ozw/cover.py index 229df25abeb..0ac2da91e44 100644 --- a/homeassistant/components/ozw/cover.py +++ b/homeassistant/components/ozw/cover.py @@ -1,6 +1,4 @@ """Support for Z-Wave cover devices.""" -import logging - from openzwavemqtt.const import CommandClass from homeassistant.components.cover import ( @@ -18,9 +16,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from .const import DATA_UNSUBSCRIBE, DOMAIN from .entity import ZWaveDeviceEntity -_LOGGER = logging.getLogger(__name__) - - SUPPORTED_FEATURES_POSITION = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_SET_POSITION SUPPORT_GARAGE = SUPPORT_OPEN | SUPPORT_CLOSE VALUE_SELECTED_ID = "Selected_id" diff --git a/homeassistant/components/panasonic_bluray/media_player.py b/homeassistant/components/panasonic_bluray/media_player.py index ddbd9f6670b..792ee644bd9 100644 --- a/homeassistant/components/panasonic_bluray/media_player.py +++ b/homeassistant/components/panasonic_bluray/media_player.py @@ -1,6 +1,5 @@ """Support for Panasonic Blu-ray players.""" from datetime import timedelta -import logging from panacotta import PanasonicBD import voluptuous as vol @@ -23,8 +22,6 @@ from homeassistant.const import ( import homeassistant.helpers.config_validation as cv from homeassistant.util.dt import utcnow -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "Panasonic Blu-Ray" SCAN_INTERVAL = timedelta(seconds=30) diff --git a/homeassistant/components/pcal9535a/binary_sensor.py b/homeassistant/components/pcal9535a/binary_sensor.py index 8e14ea8ce69..79ad8eb8016 100644 --- a/homeassistant/components/pcal9535a/binary_sensor.py +++ b/homeassistant/components/pcal9535a/binary_sensor.py @@ -1,6 +1,4 @@ """Support for binary sensor using I2C PCAL9535A chip.""" -import logging - from pcal9535a import PCAL9535A import voluptuous as vol @@ -8,8 +6,6 @@ from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensor from homeassistant.const import DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_INVERT_LOGIC = "invert_logic" CONF_I2C_ADDRESS = "i2c_address" CONF_I2C_BUS = "i2c_bus" diff --git a/homeassistant/components/pcal9535a/switch.py b/homeassistant/components/pcal9535a/switch.py index 7b4cc919dbd..897d41e9d98 100644 --- a/homeassistant/components/pcal9535a/switch.py +++ b/homeassistant/components/pcal9535a/switch.py @@ -1,6 +1,4 @@ """Support for switch sensor using I2C PCAL9535A chip.""" -import logging - from pcal9535a import PCAL9535A import voluptuous as vol @@ -8,8 +6,6 @@ from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_INVERT_LOGIC = "invert_logic" CONF_I2C_ADDRESS = "i2c_address" CONF_I2C_BUS = "i2c_bus" diff --git a/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py b/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py index 4eb90101710..61cedb8f063 100644 --- a/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py +++ b/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py @@ -1,6 +1,4 @@ """Support for binary sensor using RPi GPIO.""" -import logging - from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error import voluptuous as vol @@ -8,8 +6,6 @@ from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensor from homeassistant.const import DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_INVERT_LOGIC = "invert_logic" CONF_PINS = "pins" CONF_I2CBUS = "i2c_bus" diff --git a/homeassistant/components/pi4ioe5v9xxxx/switch.py b/homeassistant/components/pi4ioe5v9xxxx/switch.py index a147c7f310d..6bac673459f 100644 --- a/homeassistant/components/pi4ioe5v9xxxx/switch.py +++ b/homeassistant/components/pi4ioe5v9xxxx/switch.py @@ -1,6 +1,4 @@ """Allows to configure a switch using RPi GPIO.""" -import logging - from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error import voluptuous as vol @@ -8,8 +6,6 @@ from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_PINS = "pins" CONF_INVERT_LOGIC = "invert_logic" CONF_I2CBUS = "i2c_bus" diff --git a/homeassistant/components/pi_hole/binary_sensor.py b/homeassistant/components/pi_hole/binary_sensor.py index d572bb390e5..714a9f669c8 100644 --- a/homeassistant/components/pi_hole/binary_sensor.py +++ b/homeassistant/components/pi_hole/binary_sensor.py @@ -1,14 +1,10 @@ """Support for getting status from a Pi-hole system.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.const import CONF_NAME from . import PiHoleEntity from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN as PIHOLE_DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up the Pi-hole binary sensor.""" diff --git a/homeassistant/components/pi_hole/sensor.py b/homeassistant/components/pi_hole/sensor.py index 179e61a21cc..2f5873b14c1 100644 --- a/homeassistant/components/pi_hole/sensor.py +++ b/homeassistant/components/pi_hole/sensor.py @@ -1,5 +1,4 @@ """Support for getting statistical data from a Pi-hole system.""" -import logging from homeassistant.const import CONF_NAME @@ -13,8 +12,6 @@ from .const import ( SENSOR_LIST, ) -LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up the Pi-hole sensor.""" diff --git a/homeassistant/components/pilight/base_class.py b/homeassistant/components/pilight/base_class.py index 382d47f41cd..95eb987875b 100644 --- a/homeassistant/components/pilight/base_class.py +++ b/homeassistant/components/pilight/base_class.py @@ -1,6 +1,4 @@ """Base class for pilight.""" -import logging - import voluptuous as vol from homeassistant.components.pilight import DOMAIN, EVENT, SERVICE_NAME @@ -28,8 +26,6 @@ from .const import ( CONF_UNITCODE, ) -_LOGGER = logging.getLogger(__name__) - COMMAND_SCHEMA = vol.Schema( { vol.Optional(CONF_PROTOCOL): cv.string, diff --git a/homeassistant/components/pilight/binary_sensor.py b/homeassistant/components/pilight/binary_sensor.py index a53e575b875..e380d39bef4 100644 --- a/homeassistant/components/pilight/binary_sensor.py +++ b/homeassistant/components/pilight/binary_sensor.py @@ -1,6 +1,5 @@ """Support for Pilight binary sensors.""" import datetime -import logging import voluptuous as vol @@ -17,8 +16,6 @@ from homeassistant.helpers import config_validation as cv from homeassistant.helpers.event import track_point_in_time from homeassistant.util import dt as dt_util -_LOGGER = logging.getLogger(__name__) - CONF_VARIABLE = "variable" CONF_RESET_DELAY_SEC = "reset_delay_sec" diff --git a/homeassistant/components/pilight/light.py b/homeassistant/components/pilight/light.py index 11eeb02293e..1ab7cd207c1 100644 --- a/homeassistant/components/pilight/light.py +++ b/homeassistant/components/pilight/light.py @@ -1,6 +1,4 @@ """Support for switching devices via Pilight to on and off.""" -import logging - import voluptuous as vol from homeassistant.components.light import ( @@ -15,8 +13,6 @@ import homeassistant.helpers.config_validation as cv from .base_class import SWITCHES_SCHEMA, PilightBaseDevice from .const import CONF_DIMLEVEL_MAX, CONF_DIMLEVEL_MIN -_LOGGER = logging.getLogger(__name__) - LIGHTS_SCHEMA = SWITCHES_SCHEMA.extend( { vol.Optional(CONF_DIMLEVEL_MIN, default=0): cv.positive_int, diff --git a/homeassistant/components/pilight/switch.py b/homeassistant/components/pilight/switch.py index 8fb2229f55c..e190df32732 100644 --- a/homeassistant/components/pilight/switch.py +++ b/homeassistant/components/pilight/switch.py @@ -1,6 +1,4 @@ """Support for switching devices via Pilight to on and off.""" -import logging - import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -9,8 +7,6 @@ import homeassistant.helpers.config_validation as cv from .base_class import SWITCHES_SCHEMA, PilightBaseDevice -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( {vol.Required(CONF_SWITCHES): vol.Schema({cv.string: SWITCHES_SCHEMA})} ) diff --git a/homeassistant/components/pjlink/media_player.py b/homeassistant/components/pjlink/media_player.py index e601650d08c..74536ba8393 100644 --- a/homeassistant/components/pjlink/media_player.py +++ b/homeassistant/components/pjlink/media_player.py @@ -1,6 +1,4 @@ """Support for controlling projector via the PJLink protocol.""" -import logging - from pypjlink import MUTE_AUDIO, Projector from pypjlink.projector import ProjectorError import voluptuous as vol @@ -22,8 +20,6 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_ENCODING = "encoding" DEFAULT_PORT = 4352 diff --git a/homeassistant/components/plugwise/__init__.py b/homeassistant/components/plugwise/__init__.py index 5a684a233eb..ee6c44bc558 100644 --- a/homeassistant/components/plugwise/__init__.py +++ b/homeassistant/components/plugwise/__init__.py @@ -1,7 +1,5 @@ """Plugwise platform for Home Assistant Core.""" - import asyncio -import logging import voluptuous as vol @@ -14,8 +12,6 @@ from .gateway import async_setup_entry_gw CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA) -_LOGGER = logging.getLogger(__name__) - async def async_setup(hass: HomeAssistant, config: dict): """Set up the Plugwise platform.""" diff --git a/homeassistant/components/plum_lightpad/light.py b/homeassistant/components/plum_lightpad/light.py index a94014ff1f9..feacec4492b 100644 --- a/homeassistant/components/plum_lightpad/light.py +++ b/homeassistant/components/plum_lightpad/light.py @@ -1,6 +1,5 @@ """Support for Plum Lightpad lights.""" import asyncio -import logging from typing import Callable, List from plumlightpad import Plum @@ -20,8 +19,6 @@ import homeassistant.util.color as color_util from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/poolsense/binary_sensor.py b/homeassistant/components/poolsense/binary_sensor.py index 6c3f5dc4cda..ea07f1637a6 100644 --- a/homeassistant/components/poolsense/binary_sensor.py +++ b/homeassistant/components/poolsense/binary_sensor.py @@ -1,6 +1,4 @@ """Support for PoolSense binary sensors.""" -import logging - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_PROBLEM, BinarySensorEntity, @@ -10,8 +8,6 @@ from homeassistant.const import CONF_EMAIL from . import PoolSenseEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - BINARY_SENSORS = { "pH Status": { "unit": None, diff --git a/homeassistant/components/poolsense/sensor.py b/homeassistant/components/poolsense/sensor.py index b79f7499bcd..a64cc0aef61 100644 --- a/homeassistant/components/poolsense/sensor.py +++ b/homeassistant/components/poolsense/sensor.py @@ -1,6 +1,4 @@ """Sensor platform for the PoolSense sensor.""" -import logging - from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_EMAIL, @@ -15,8 +13,6 @@ from homeassistant.helpers.entity import Entity from . import PoolSenseEntity from .const import ATTRIBUTION, DOMAIN -_LOGGER = logging.getLogger(__name__) - SENSORS = { "Chlorine": { "unit": "mV", diff --git a/homeassistant/components/powerwall/binary_sensor.py b/homeassistant/components/powerwall/binary_sensor.py index 1d38e167134..1cacaa5fc42 100644 --- a/homeassistant/components/powerwall/binary_sensor.py +++ b/homeassistant/components/powerwall/binary_sensor.py @@ -1,6 +1,4 @@ """Support for powerwall binary sensors.""" -import logging - from tesla_powerwall import GridStatus from homeassistant.components.binary_sensor import ( @@ -23,8 +21,6 @@ from .const import ( ) from .entity import PowerWallEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the August sensors.""" diff --git a/homeassistant/components/profiler/__init__.py b/homeassistant/components/profiler/__init__.py index 3c989e13eeb..518e448d4ec 100644 --- a/homeassistant/components/profiler/__init__.py +++ b/homeassistant/components/profiler/__init__.py @@ -1,7 +1,6 @@ """The profiler integration.""" import asyncio import cProfile -import logging import time from pyprof2calltree import convert @@ -17,8 +16,6 @@ from .const import DOMAIN SERVICE_START = "start" CONF_SECONDS = "seconds" -_LOGGER = logging.getLogger(__name__) - async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the profiler component.""" diff --git a/homeassistant/components/profiler/config_flow.py b/homeassistant/components/profiler/config_flow.py index 73f4f86255b..9a71b64a179 100644 --- a/homeassistant/components/profiler/config_flow.py +++ b/homeassistant/components/profiler/config_flow.py @@ -1,6 +1,4 @@ """Config flow for Profiler integration.""" -import logging - import voluptuous as vol from homeassistant import config_entries @@ -8,8 +6,6 @@ from homeassistant import config_entries from .const import DEFAULT_NAME from .const import DOMAIN # pylint: disable=unused-import -_LOGGER = logging.getLogger(__name__) - class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow for Profiler.""" diff --git a/homeassistant/components/ps4/config_flow.py b/homeassistant/components/ps4/config_flow.py index 38e18d624ef..a8bdb2b9c43 100644 --- a/homeassistant/components/ps4/config_flow.py +++ b/homeassistant/components/ps4/config_flow.py @@ -1,6 +1,5 @@ """Config Flow for PlayStation 4.""" from collections import OrderedDict -import logging from pyps4_2ndscreen.errors import CredentialTimeout from pyps4_2ndscreen.helpers import Helper @@ -20,8 +19,6 @@ from homeassistant.util import location from .const import CONFIG_ENTRY_VERSION, DEFAULT_ALIAS, DEFAULT_NAME, DOMAIN -_LOGGER = logging.getLogger(__name__) - CONF_MODE = "Config Mode" CONF_AUTO = "Auto Discover" CONF_MANUAL = "Manual Entry" diff --git a/homeassistant/components/rainbird/switch.py b/homeassistant/components/rainbird/switch.py index ce6cf9d1b22..bccd4d2986c 100644 --- a/homeassistant/components/rainbird/switch.py +++ b/homeassistant/components/rainbird/switch.py @@ -1,7 +1,4 @@ """Support for Rain Bird Irrigation system LNK WiFi Module.""" - -import logging - from pyrainbird import AvailableStations, RainbirdController import voluptuous as vol @@ -11,8 +8,6 @@ from homeassistant.helpers import config_validation as cv from . import CONF_ZONES, DATA_RAINBIRD, DOMAIN, RAINBIRD_CONTROLLER -_LOGGER = logging.getLogger(__name__) - ATTR_DURATION = "duration" SERVICE_START_IRRIGATION = "start_irrigation" diff --git a/homeassistant/components/rainmachine/binary_sensor.py b/homeassistant/components/rainmachine/binary_sensor.py index b3f7ffb7d6b..e2ef8cea64b 100644 --- a/homeassistant/components/rainmachine/binary_sensor.py +++ b/homeassistant/components/rainmachine/binary_sensor.py @@ -1,6 +1,4 @@ """This platform provides binary sensors for key RainMachine data.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -15,8 +13,6 @@ from .const import ( SENSOR_UPDATE_TOPIC, ) -_LOGGER = logging.getLogger(__name__) - TYPE_FLOW_SENSOR = "flow_sensor" TYPE_FREEZE = "freeze" TYPE_FREEZE_PROTECTION = "freeze_protection" diff --git a/homeassistant/components/rainmachine/sensor.py b/homeassistant/components/rainmachine/sensor.py index 8534748978d..ef1b88e6489 100644 --- a/homeassistant/components/rainmachine/sensor.py +++ b/homeassistant/components/rainmachine/sensor.py @@ -1,6 +1,4 @@ """This platform provides support for sensor data from RainMachine.""" -import logging - from homeassistant.const import TEMP_CELSIUS, VOLUME_CUBIC_METERS from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -14,8 +12,6 @@ from .const import ( SENSOR_UPDATE_TOPIC, ) -_LOGGER = logging.getLogger(__name__) - TYPE_FLOW_SENSOR_CLICK_M3 = "flow_sensor_clicks_cubic_meter" TYPE_FLOW_SENSOR_CONSUMED_LITERS = "flow_sensor_consumed_liters" TYPE_FLOW_SENSOR_START_INDEX = "flow_sensor_start_index" diff --git a/homeassistant/components/random/binary_sensor.py b/homeassistant/components/random/binary_sensor.py index baec29c5937..7cd1208a3ee 100644 --- a/homeassistant/components/random/binary_sensor.py +++ b/homeassistant/components/random/binary_sensor.py @@ -1,5 +1,4 @@ """Support for showing random states.""" -import logging from random import getrandbits import voluptuous as vol @@ -12,8 +11,6 @@ from homeassistant.components.binary_sensor import ( from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "Random Binary Sensor" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/random/sensor.py b/homeassistant/components/random/sensor.py index 4ebd710f103..58d996bc6ec 100644 --- a/homeassistant/components/random/sensor.py +++ b/homeassistant/components/random/sensor.py @@ -1,5 +1,4 @@ """Support for showing random numbers.""" -import logging from random import randrange import voluptuous as vol @@ -14,8 +13,6 @@ from homeassistant.const import ( import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - ATTR_MAXIMUM = "maximum" ATTR_MINIMUM = "minimum" diff --git a/homeassistant/components/raspyrfm/switch.py b/homeassistant/components/raspyrfm/switch.py index cd4e28e1f10..56c42cf7e69 100644 --- a/homeassistant/components/raspyrfm/switch.py +++ b/homeassistant/components/raspyrfm/switch.py @@ -1,6 +1,4 @@ """Support for switches that can be controlled using the RaspyRFM rc module.""" -import logging - from raspyrfm_client import RaspyRFMClient from raspyrfm_client.device_implementations.controlunit.actions import Action from raspyrfm_client.device_implementations.controlunit.controlunit_constants import ( @@ -22,8 +20,6 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_GATEWAY_MANUFACTURER = "gateway_manufacturer" CONF_GATEWAY_MODEL = "gateway_model" CONF_CONTROLUNIT_MANUFACTURER = "controlunit_manufacturer" diff --git a/homeassistant/components/remote_rpi_gpio/__init__.py b/homeassistant/components/remote_rpi_gpio/__init__.py index aa0a75c3331..afa60e44bed 100644 --- a/homeassistant/components/remote_rpi_gpio/__init__.py +++ b/homeassistant/components/remote_rpi_gpio/__init__.py @@ -1,11 +1,7 @@ """Support for controlling GPIO pins of a Raspberry Pi.""" -import logging - from gpiozero import LED, Button from gpiozero.pins.pigpio import PiGPIOFactory -_LOGGER = logging.getLogger(__name__) - CONF_BOUNCETIME = "bouncetime" CONF_INVERT_LOGIC = "invert_logic" CONF_PULL_MODE = "pull_mode" diff --git a/homeassistant/components/remote_rpi_gpio/binary_sensor.py b/homeassistant/components/remote_rpi_gpio/binary_sensor.py index d97183de86e..86966ec4d87 100644 --- a/homeassistant/components/remote_rpi_gpio/binary_sensor.py +++ b/homeassistant/components/remote_rpi_gpio/binary_sensor.py @@ -1,6 +1,4 @@ """Support for binary sensor using RPi GPIO.""" -import logging - import requests import voluptuous as vol @@ -18,8 +16,6 @@ from . import ( ) from .. import remote_rpi_gpio -_LOGGER = logging.getLogger(__name__) - CONF_PORTS = "ports" _SENSORS_SCHEMA = vol.Schema({cv.positive_int: cv.string}) diff --git a/homeassistant/components/remote_rpi_gpio/switch.py b/homeassistant/components/remote_rpi_gpio/switch.py index 48e072a5d6b..6730342e260 100644 --- a/homeassistant/components/remote_rpi_gpio/switch.py +++ b/homeassistant/components/remote_rpi_gpio/switch.py @@ -1,6 +1,4 @@ """Allows to configure a switch using RPi GPIO.""" -import logging - import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -10,8 +8,6 @@ import homeassistant.helpers.config_validation as cv from . import CONF_INVERT_LOGIC, DEFAULT_INVERT_LOGIC from .. import remote_rpi_gpio -_LOGGER = logging.getLogger(__name__) - CONF_PORTS = "ports" _SENSORS_SCHEMA = vol.Schema({cv.positive_int: cv.string}) diff --git a/homeassistant/components/rest/binary_sensor.py b/homeassistant/components/rest/binary_sensor.py index 82df088b01a..5d185889e24 100644 --- a/homeassistant/components/rest/binary_sensor.py +++ b/homeassistant/components/rest/binary_sensor.py @@ -1,6 +1,4 @@ """Support for RESTful binary sensors.""" -import logging - import httpx import voluptuous as vol @@ -34,8 +32,6 @@ from homeassistant.helpers.reload import async_setup_reload_service from . import DOMAIN, PLATFORMS from .sensor import RestData -_LOGGER = logging.getLogger(__name__) - DEFAULT_METHOD = "GET" DEFAULT_NAME = "REST Binary Sensor" DEFAULT_VERIFY_SSL = True diff --git a/homeassistant/components/rflink/binary_sensor.py b/homeassistant/components/rflink/binary_sensor.py index 8962af3c0d4..dd16343898d 100644 --- a/homeassistant/components/rflink/binary_sensor.py +++ b/homeassistant/components/rflink/binary_sensor.py @@ -1,6 +1,4 @@ """Support for Rflink binary sensors.""" -import logging - import voluptuous as vol from homeassistant.components.binary_sensor import ( @@ -17,8 +15,6 @@ from . import CONF_ALIASES, CONF_DEVICES, RflinkDevice CONF_OFF_DELAY = "off_delay" DEFAULT_FORCE_UPDATE = False -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Optional(CONF_DEVICES, default={}): { diff --git a/homeassistant/components/rflink/sensor.py b/homeassistant/components/rflink/sensor.py index 9394c568a73..2c27477e6c6 100644 --- a/homeassistant/components/rflink/sensor.py +++ b/homeassistant/components/rflink/sensor.py @@ -1,6 +1,4 @@ """Support for Rflink sensors.""" -import logging - from rflink.parser import PACKET_FIELDS, UNITS import voluptuous as vol @@ -28,8 +26,6 @@ from . import ( RflinkDevice, ) -_LOGGER = logging.getLogger(__name__) - SENSOR_ICONS = { "humidity": "mdi:water-percent", "battery": "mdi:battery", diff --git a/homeassistant/components/rflink/switch.py b/homeassistant/components/rflink/switch.py index 266f9a4625e..77e1f821bad 100644 --- a/homeassistant/components/rflink/switch.py +++ b/homeassistant/components/rflink/switch.py @@ -1,6 +1,4 @@ """Support for Rflink switches.""" -import logging - import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -20,8 +18,6 @@ from . import ( SwitchableRflinkDevice, ) -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 0 PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/rfxtrx/config_flow.py b/homeassistant/components/rfxtrx/config_flow.py index e1d30405b15..624b7ade69d 100644 --- a/homeassistant/components/rfxtrx/config_flow.py +++ b/homeassistant/components/rfxtrx/config_flow.py @@ -1,6 +1,5 @@ """Config flow for RFXCOM RFXtrx integration.""" import copy -import logging import os import RFXtrx as rfxtrxmod @@ -47,8 +46,6 @@ from .cover import supported as cover_supported from .light import supported as light_supported from .switch import supported as switch_supported -_LOGGER = logging.getLogger(__name__) - CONF_EVENT_CODE = "event_code" CONF_MANUAL_PATH = "Enter Manually" diff --git a/homeassistant/components/ring/binary_sensor.py b/homeassistant/components/ring/binary_sensor.py index ccec9e6ad36..bbfbbf1690e 100644 --- a/homeassistant/components/ring/binary_sensor.py +++ b/homeassistant/components/ring/binary_sensor.py @@ -1,6 +1,5 @@ """This component provides HA sensor support for Ring Door Bell/Chimes.""" from datetime import datetime -import logging from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, @@ -12,8 +11,6 @@ from homeassistant.core import callback from . import DOMAIN from .entity import RingEntityMixin -_LOGGER = logging.getLogger(__name__) - # Sensor types: Name, category, device_class SENSOR_TYPES = { "ding": ["Ding", ["doorbots", "authorized_doorbots"], DEVICE_CLASS_OCCUPANCY], diff --git a/homeassistant/components/ring/sensor.py b/homeassistant/components/ring/sensor.py index f59c3b2e61d..0a1cc85230f 100644 --- a/homeassistant/components/ring/sensor.py +++ b/homeassistant/components/ring/sensor.py @@ -1,6 +1,4 @@ """This component provides HA sensor support for Ring Door Bell/Chimes.""" -import logging - from homeassistant.const import PERCENTAGE, SIGNAL_STRENGTH_DECIBELS_MILLIWATT from homeassistant.core import callback from homeassistant.helpers.entity import Entity @@ -9,8 +7,6 @@ from homeassistant.helpers.icon import icon_for_battery_level from . import DOMAIN from .entity import RingEntityMixin -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up a sensor for a Ring device.""" diff --git a/homeassistant/components/roomba/binary_sensor.py b/homeassistant/components/roomba/binary_sensor.py index 9acea9e4dbe..ea39fba2f8e 100644 --- a/homeassistant/components/roomba/binary_sensor.py +++ b/homeassistant/components/roomba/binary_sensor.py @@ -1,14 +1,10 @@ """Roomba binary sensor entities.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from . import roomba_reported_state from .const import BLID, DOMAIN, ROOMBA_SESSION from .irobot_base import IRobotEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the iRobot Roomba vacuum cleaner.""" diff --git a/homeassistant/components/roomba/config_flow.py b/homeassistant/components/roomba/config_flow.py index cffbb3de4c9..b25c4ece440 100644 --- a/homeassistant/components/roomba/config_flow.py +++ b/homeassistant/components/roomba/config_flow.py @@ -1,6 +1,4 @@ """Config flow to configure roomba component.""" -import logging - from roomba import Roomba import voluptuous as vol @@ -30,8 +28,6 @@ DATA_SCHEMA = vol.Schema( } ) -_LOGGER = logging.getLogger(__name__) - async def validate_input(hass: core.HomeAssistant, data): """Validate the user input allows us to connect. diff --git a/homeassistant/components/roomba/sensor.py b/homeassistant/components/roomba/sensor.py index 54ea1eade0d..f2d08f08772 100644 --- a/homeassistant/components/roomba/sensor.py +++ b/homeassistant/components/roomba/sensor.py @@ -1,6 +1,4 @@ """Sensor for checking the battery level of Roomba.""" -import logging - from homeassistant.components.vacuum import STATE_DOCKED from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.icon import icon_for_battery_level @@ -8,8 +6,6 @@ from homeassistant.helpers.icon import icon_for_battery_level from .const import BLID, DOMAIN, ROOMBA_SESSION from .irobot_base import IRobotEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the iRobot Roomba vacuum cleaner.""" diff --git a/homeassistant/components/roomba/vacuum.py b/homeassistant/components/roomba/vacuum.py index bc2e58846d1..f4e0d4f0138 100644 --- a/homeassistant/components/roomba/vacuum.py +++ b/homeassistant/components/roomba/vacuum.py @@ -1,13 +1,9 @@ """Support for Wi-Fi enabled iRobot Roombas.""" -import logging - from . import roomba_reported_state from .braava import BraavaJet from .const import BLID, DOMAIN, ROOMBA_SESSION from .roomba import RoombaVacuum, RoombaVacuumCarpetBoost -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the iRobot Roomba vacuum cleaner.""" diff --git a/homeassistant/components/roon/__init__.py b/homeassistant/components/roon/__init__.py index ff45e2c16cf..49527a44245 100644 --- a/homeassistant/components/roon/__init__.py +++ b/homeassistant/components/roon/__init__.py @@ -1,14 +1,10 @@ """Roon (www.roonlabs.com) component.""" -import logging - from homeassistant.const import CONF_HOST from homeassistant.helpers import device_registry as dr from .const import DOMAIN from .server import RoonServer -_LOGGER = logging.getLogger(__name__) - async def async_setup(hass, config): """Set up the Roon platform.""" diff --git a/homeassistant/components/rpi_camera/__init__.py b/homeassistant/components/rpi_camera/__init__.py index 2f962872d8c..a854338ee78 100644 --- a/homeassistant/components/rpi_camera/__init__.py +++ b/homeassistant/components/rpi_camera/__init__.py @@ -1,6 +1,4 @@ """The rpi_camera component.""" -import logging - import voluptuous as vol from homeassistant.const import CONF_FILE_PATH, CONF_NAME @@ -27,8 +25,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - CONFIG_SCHEMA = vol.Schema( { DOMAIN: vol.Schema( diff --git a/homeassistant/components/rpi_gpio/__init__.py b/homeassistant/components/rpi_gpio/__init__.py index b3a83646f0e..75aa5bccdb6 100644 --- a/homeassistant/components/rpi_gpio/__init__.py +++ b/homeassistant/components/rpi_gpio/__init__.py @@ -1,12 +1,8 @@ """Support for controlling GPIO pins of a Raspberry Pi.""" -import logging - from RPi import GPIO # pylint: disable=import-error from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP -_LOGGER = logging.getLogger(__name__) - DOMAIN = "rpi_gpio" PLATFORMS = ["binary_sensor", "cover", "switch"] diff --git a/homeassistant/components/rpi_gpio/binary_sensor.py b/homeassistant/components/rpi_gpio/binary_sensor.py index 527da2a7096..a2461f52db9 100644 --- a/homeassistant/components/rpi_gpio/binary_sensor.py +++ b/homeassistant/components/rpi_gpio/binary_sensor.py @@ -1,6 +1,4 @@ """Support for binary sensor using RPi GPIO.""" -import logging - import voluptuous as vol from homeassistant.components import rpi_gpio @@ -11,8 +9,6 @@ from homeassistant.helpers.reload import setup_reload_service from . import DOMAIN, PLATFORMS -_LOGGER = logging.getLogger(__name__) - CONF_BOUNCETIME = "bouncetime" CONF_INVERT_LOGIC = "invert_logic" CONF_PORTS = "ports" diff --git a/homeassistant/components/rpi_gpio/cover.py b/homeassistant/components/rpi_gpio/cover.py index fab35da31fb..032796fe55b 100644 --- a/homeassistant/components/rpi_gpio/cover.py +++ b/homeassistant/components/rpi_gpio/cover.py @@ -1,5 +1,4 @@ """Support for controlling a Raspberry Pi cover.""" -import logging from time import sleep import voluptuous as vol @@ -12,8 +11,6 @@ from homeassistant.helpers.reload import setup_reload_service from . import DOMAIN, PLATFORMS -_LOGGER = logging.getLogger(__name__) - CONF_COVERS = "covers" CONF_RELAY_PIN = "relay_pin" CONF_RELAY_TIME = "relay_time" diff --git a/homeassistant/components/rpi_gpio/switch.py b/homeassistant/components/rpi_gpio/switch.py index 047bff39c95..d556d8f0354 100644 --- a/homeassistant/components/rpi_gpio/switch.py +++ b/homeassistant/components/rpi_gpio/switch.py @@ -1,6 +1,4 @@ """Allows to configure a switch using RPi GPIO.""" -import logging - import voluptuous as vol from homeassistant.components import rpi_gpio @@ -12,8 +10,6 @@ from homeassistant.helpers.reload import setup_reload_service from . import DOMAIN, PLATFORMS -_LOGGER = logging.getLogger(__name__) - CONF_PULL_MODE = "pull_mode" CONF_PORTS = "ports" CONF_INVERT_LOGIC = "invert_logic" diff --git a/homeassistant/components/rpi_pfio/__init__.py b/homeassistant/components/rpi_pfio/__init__.py index d02b2bc5610..45b3e98d977 100644 --- a/homeassistant/components/rpi_pfio/__init__.py +++ b/homeassistant/components/rpi_pfio/__init__.py @@ -1,12 +1,8 @@ """Support for controlling the PiFace Digital I/O module on a RPi.""" -import logging - import pifacedigitalio as PFIO from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP -_LOGGER = logging.getLogger(__name__) - DOMAIN = "rpi_pfio" DATA_PFIO_LISTENER = "pfio_listener" diff --git a/homeassistant/components/rpi_pfio/binary_sensor.py b/homeassistant/components/rpi_pfio/binary_sensor.py index e77ceea3eb7..5d1d46e8a39 100644 --- a/homeassistant/components/rpi_pfio/binary_sensor.py +++ b/homeassistant/components/rpi_pfio/binary_sensor.py @@ -1,6 +1,4 @@ """Support for binary sensor using the PiFace Digital I/O module on a RPi.""" -import logging - import voluptuous as vol from homeassistant.components import rpi_pfio @@ -8,8 +6,6 @@ from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensor from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_INVERT_LOGIC = "invert_logic" CONF_PORTS = "ports" CONF_SETTLE_TIME = "settle_time" diff --git a/homeassistant/components/rpi_pfio/switch.py b/homeassistant/components/rpi_pfio/switch.py index bc3d99b5256..91a98cdec59 100644 --- a/homeassistant/components/rpi_pfio/switch.py +++ b/homeassistant/components/rpi_pfio/switch.py @@ -1,6 +1,4 @@ """Support for switches using the PiFace Digital I/O module on a RPi.""" -import logging - import voluptuous as vol from homeassistant.components import rpi_pfio @@ -9,8 +7,6 @@ from homeassistant.const import ATTR_NAME, DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import ToggleEntity -_LOGGER = logging.getLogger(__name__) - ATTR_INVERT_LOGIC = "invert_logic" CONF_PORTS = "ports" diff --git a/homeassistant/components/russound_rio/media_player.py b/homeassistant/components/russound_rio/media_player.py index d65ef1ce0e5..b2c8250afc4 100644 --- a/homeassistant/components/russound_rio/media_player.py +++ b/homeassistant/components/russound_rio/media_player.py @@ -1,6 +1,4 @@ """Support for Russound multizone controllers using RIO Protocol.""" -import logging - from russound_rio import Russound import voluptuous as vol @@ -24,8 +22,6 @@ from homeassistant.const import ( from homeassistant.core import callback import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - SUPPORT_RUSSOUND = ( SUPPORT_VOLUME_MUTE | SUPPORT_VOLUME_SET diff --git a/homeassistant/components/sabnzbd/sensor.py b/homeassistant/components/sabnzbd/sensor.py index b232e2e63c5..5e437c41b23 100644 --- a/homeassistant/components/sabnzbd/sensor.py +++ b/homeassistant/components/sabnzbd/sensor.py @@ -1,13 +1,9 @@ """Support for monitoring an SABnzbd NZB client.""" -import logging - from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from . import DATA_SABNZBD, SENSOR_TYPES, SIGNAL_SABNZBD_UPDATED -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the SABnzbd sensors.""" diff --git a/homeassistant/components/satel_integra/binary_sensor.py b/homeassistant/components/satel_integra/binary_sensor.py index ea9c19376f6..5acc49d1d1b 100644 --- a/homeassistant/components/satel_integra/binary_sensor.py +++ b/homeassistant/components/satel_integra/binary_sensor.py @@ -1,6 +1,4 @@ """Support for Satel Integra zone states- represented as binary sensors.""" -import logging - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_SMOKE, BinarySensorEntity, @@ -18,8 +16,6 @@ from . import ( SIGNAL_ZONES_UPDATED, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Satel Integra binary sensor devices.""" diff --git a/homeassistant/components/scene/__init__.py b/homeassistant/components/scene/__init__.py index f4eee8da836..245d21770ee 100644 --- a/homeassistant/components/scene/__init__.py +++ b/homeassistant/components/scene/__init__.py @@ -59,8 +59,9 @@ PLATFORM_SCHEMA = vol.Schema( async def async_setup(hass, config): """Set up the scenes.""" - logger = logging.getLogger(__name__) - component = hass.data[DOMAIN] = EntityComponent(logger, DOMAIN, hass) + component = hass.data[DOMAIN] = EntityComponent( + logging.getLogger(__name__), DOMAIN, hass + ) await component.async_setup(config) # Ensure Home Assistant platform always loaded. diff --git a/homeassistant/components/scsgate/cover.py b/homeassistant/components/scsgate/cover.py index 0c7d057316c..e5442226d80 100644 --- a/homeassistant/components/scsgate/cover.py +++ b/homeassistant/components/scsgate/cover.py @@ -14,8 +14,6 @@ import homeassistant.helpers.config_validation as cv from . import CONF_SCS_ID, DOMAIN, SCSGATE_SCHEMA -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( {vol.Required(CONF_DEVICES): cv.schema_with_slug_keys(SCSGATE_SCHEMA)} ) diff --git a/homeassistant/components/scsgate/light.py b/homeassistant/components/scsgate/light.py index c8f5b720c70..949041534a8 100644 --- a/homeassistant/components/scsgate/light.py +++ b/homeassistant/components/scsgate/light.py @@ -10,8 +10,6 @@ import homeassistant.helpers.config_validation as cv from . import CONF_SCS_ID, DOMAIN, SCSGATE_SCHEMA -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( {vol.Required(CONF_DEVICES): cv.schema_with_slug_keys(SCSGATE_SCHEMA)} ) diff --git a/homeassistant/components/sense/sensor.py b/homeassistant/components/sense/sensor.py index 8e023601eb7..197168f9199 100644 --- a/homeassistant/components/sense/sensor.py +++ b/homeassistant/components/sense/sensor.py @@ -1,6 +1,4 @@ """Support for monitoring a Sense energy sensor.""" -import logging - from homeassistant.const import ( ATTR_ATTRIBUTION, DEVICE_CLASS_POWER, @@ -30,8 +28,6 @@ from .const import ( SENSE_TRENDS_COORDINATOR, ) -_LOGGER = logging.getLogger(__name__) - class SensorConfig: """Data structure holding sensor configuration.""" diff --git a/homeassistant/components/sensehat/light.py b/homeassistant/components/sensehat/light.py index 5eda783bebf..72a261aabf6 100644 --- a/homeassistant/components/sensehat/light.py +++ b/homeassistant/components/sensehat/light.py @@ -1,6 +1,4 @@ """Support for Sense Hat LEDs.""" -import logging - from sense_hat import SenseHat import voluptuous as vol @@ -16,8 +14,6 @@ from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv import homeassistant.util.color as color_util -_LOGGER = logging.getLogger(__name__) - SUPPORT_SENSEHAT = SUPPORT_BRIGHTNESS | SUPPORT_COLOR DEFAULT_NAME = "sensehat" diff --git a/homeassistant/components/sharkiq/__init__.py b/homeassistant/components/sharkiq/__init__.py index 968ee91f8d6..b7684f98855 100644 --- a/homeassistant/components/sharkiq/__init__.py +++ b/homeassistant/components/sharkiq/__init__.py @@ -14,7 +14,7 @@ from sharkiqpy import ( from homeassistant import exceptions from homeassistant.const import CONF_PASSWORD, CONF_USERNAME -from .const import API_TIMEOUT, COMPONENTS, DOMAIN, LOGGER +from .const import _LOGGER, API_TIMEOUT, COMPONENTS, DOMAIN from .update_coordinator import SharkIqUpdateCoordinator @@ -32,13 +32,13 @@ async def async_connect_or_timeout(ayla_api: AylaApi) -> bool: """Connect to vacuum.""" try: with async_timeout.timeout(API_TIMEOUT): - LOGGER.debug("Initialize connection to Ayla networks API") + _LOGGER.debug("Initialize connection to Ayla networks API") await ayla_api.async_sign_in() except SharkIqAuthError: - LOGGER.error("Authentication error connecting to Shark IQ api") + _LOGGER.error("Authentication error connecting to Shark IQ api") return False except asyncio.TimeoutError as exc: - LOGGER.error("Timeout expired") + _LOGGER.error("Timeout expired") raise CannotConnect from exc return True @@ -60,7 +60,7 @@ async def async_setup_entry(hass, config_entry): shark_vacs = await ayla_api.async_get_devices(False) device_names = ", ".join([d.name for d in shark_vacs]) - LOGGER.debug("Found %d Shark IQ device(s): %s", len(shark_vacs), device_names) + _LOGGER.debug("Found %d Shark IQ device(s): %s", len(shark_vacs), device_names) coordinator = SharkIqUpdateCoordinator(hass, config_entry, ayla_api, shark_vacs) await coordinator.async_refresh() @@ -80,7 +80,7 @@ async def async_setup_entry(hass, config_entry): async def async_disconnect_or_timeout(coordinator: SharkIqUpdateCoordinator): """Disconnect to vacuum.""" - LOGGER.debug("Disconnecting from Ayla Api") + _LOGGER.debug("Disconnecting from Ayla Api") with async_timeout.timeout(5): try: await coordinator.ayla_api.async_sign_out() diff --git a/homeassistant/components/sharkiq/config_flow.py b/homeassistant/components/sharkiq/config_flow.py index 4b2e54d3e38..9d2e80b8ec6 100644 --- a/homeassistant/components/sharkiq/config_flow.py +++ b/homeassistant/components/sharkiq/config_flow.py @@ -11,7 +11,7 @@ import voluptuous as vol from homeassistant import config_entries, core, exceptions from homeassistant.const import CONF_PASSWORD, CONF_USERNAME -from .const import DOMAIN, LOGGER # pylint:disable=unused-import +from .const import _LOGGER, DOMAIN # pylint:disable=unused-import SHARKIQ_SCHEMA = vol.Schema( {vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str} @@ -28,7 +28,7 @@ async def validate_input(hass: core.HomeAssistant, data): try: with async_timeout.timeout(10): - LOGGER.debug("Initialize connection to Ayla networks API") + _LOGGER.debug("Initialize connection to Ayla networks API") await ayla_api.async_sign_in() except (asyncio.TimeoutError, aiohttp.ClientError) as errors: raise CannotConnect from errors @@ -58,7 +58,7 @@ class SharkIqConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): except InvalidAuth: errors["base"] = "invalid_auth" except Exception: # pylint: disable=broad-except - LOGGER.exception("Unexpected exception") + _LOGGER.exception("Unexpected exception") errors["base"] = "unknown" return info, errors diff --git a/homeassistant/components/sharkiq/const.py b/homeassistant/components/sharkiq/const.py index 9160fc710a2..e0feb306f77 100644 --- a/homeassistant/components/sharkiq/const.py +++ b/homeassistant/components/sharkiq/const.py @@ -1,11 +1,11 @@ """Shark IQ Constants.""" - from datetime import timedelta import logging +_LOGGER = logging.getLogger(__package__) + API_TIMEOUT = 20 COMPONENTS = ["vacuum"] DOMAIN = "sharkiq" -LOGGER = logging.getLogger(__package__) SHARK = "Shark" UPDATE_INTERVAL = timedelta(seconds=30) diff --git a/homeassistant/components/sharkiq/update_coordinator.py b/homeassistant/components/sharkiq/update_coordinator.py index 2b3f6070f3a..0651d0765cf 100644 --- a/homeassistant/components/sharkiq/update_coordinator.py +++ b/homeassistant/components/sharkiq/update_coordinator.py @@ -16,7 +16,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed -from .const import API_TIMEOUT, DOMAIN, LOGGER, UPDATE_INTERVAL +from .const import _LOGGER, API_TIMEOUT, DOMAIN, UPDATE_INTERVAL class SharkIqUpdateCoordinator(DataUpdateCoordinator): @@ -37,7 +37,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): self._config_entry = config_entry self._online_dsns = set() - super().__init__(hass, LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL) + super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL) @property def online_dsns(self) -> Set[str]: @@ -52,7 +52,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): async def _async_update_vacuum(sharkiq: SharkIqVacuum) -> None: """Asynchronously update the data for a single vacuum.""" dsn = sharkiq.serial_number - LOGGER.debug("Updating sharkiq data for device DSN %s", dsn) + _LOGGER.debug("Updating sharkiq data for device DSN %s", dsn) with timeout(API_TIMEOUT): await sharkiq.async_update() @@ -66,7 +66,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): if v["connection_status"] == "Online" and v["dsn"] in self.shark_vacs } - LOGGER.debug("Updating sharkiq data") + _LOGGER.debug("Updating sharkiq data") online_vacs = (self.shark_vacs[dsn] for dsn in self.online_dsns) await asyncio.gather(*[self._async_update_vacuum(v) for v in online_vacs]) except ( @@ -74,7 +74,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): SharkIqNotAuthedError, SharkIqAuthExpiringError, ) as err: - LOGGER.exception("Bad auth state") + _LOGGER.exception("Bad auth state") flow_context = { "source": "reauth", "unique_id": self._config_entry.unique_id, @@ -97,7 +97,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): raise UpdateFailed(err) from err except Exception as err: # pylint: disable=broad-except - LOGGER.exception("Unexpected error updating SharkIQ") + _LOGGER.exception("Unexpected error updating SharkIQ") raise UpdateFailed(err) from err return True diff --git a/homeassistant/components/sharkiq/vacuum.py b/homeassistant/components/sharkiq/vacuum.py index 96e4d98f318..9684dde45e6 100644 --- a/homeassistant/components/sharkiq/vacuum.py +++ b/homeassistant/components/sharkiq/vacuum.py @@ -28,7 +28,7 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN, SHARK from .update_coordinator import SharkIqUpdateCoordinator -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) # Supported features SUPPORT_SHARKIQ = ( @@ -71,7 +71,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): coordinator: SharkIqUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] devices: Iterable["SharkIqVacuum"] = coordinator.shark_vacs.values() device_names = [d.name for d in devices] - LOGGER.debug( + _LOGGER.debug( "Found %d Shark IQ device(s): %s", len(device_names), ", ".join([d.name for d in devices]), diff --git a/homeassistant/components/shiftr/__init__.py b/homeassistant/components/shiftr/__init__.py index 1c3cddac256..378d83d725e 100644 --- a/homeassistant/components/shiftr/__init__.py +++ b/homeassistant/components/shiftr/__init__.py @@ -1,6 +1,4 @@ """Support for Shiftr.io.""" -import logging - import paho.mqtt.client as mqtt import voluptuous as vol @@ -13,8 +11,6 @@ from homeassistant.const import ( from homeassistant.helpers import state as state_helper import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - DOMAIN = "shiftr" SHIFTR_BROKER = "broker.shiftr.io" diff --git a/homeassistant/components/simplepush/notify.py b/homeassistant/components/simplepush/notify.py index 63bcd31935e..1d101534157 100644 --- a/homeassistant/components/simplepush/notify.py +++ b/homeassistant/components/simplepush/notify.py @@ -1,6 +1,4 @@ """Simplepush notification service.""" -import logging - from simplepush import send, send_encrypted import voluptuous as vol @@ -13,8 +11,6 @@ from homeassistant.components.notify import ( from homeassistant.const import CONF_PASSWORD import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - ATTR_ENCRYPTED = "encrypted" CONF_DEVICE_KEY = "device_key" diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index 2e4dfd7c9fa..b3d031577c9 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -43,6 +43,7 @@ from homeassistant.helpers.service import ( ) from .const import ( + _LOGGER, ATTR_ALARM_DURATION, ATTR_ALARM_VOLUME, ATTR_CHIME_VOLUME, @@ -55,7 +56,6 @@ from .const import ( DATA_CLIENT, DEFAULT_SCAN_INTERVAL, DOMAIN, - LOGGER, VOLUMES, ) @@ -201,10 +201,10 @@ async def async_setup_entry(hass, config_entry): config_entry.data[CONF_TOKEN], client_id=client_id, session=websession ) except InvalidCredentialsError: - LOGGER.error("Invalid credentials provided") + _LOGGER.error("Invalid credentials provided") return False except SimplipyError as err: - LOGGER.error("Config entry failed: %s", err) + _LOGGER.error("Config entry failed: %s", err) raise ConfigEntryNotReady from err _async_save_refresh_token(hass, config_entry, api.refresh_token) @@ -226,7 +226,7 @@ async def async_setup_entry(hass, config_entry): """Decorate.""" system_id = int(call.data[ATTR_SYSTEM_ID]) if system_id not in simplisafe.systems: - LOGGER.error("Unknown system ID in service call: %s", system_id) + _LOGGER.error("Unknown system ID in service call: %s", system_id) return await coro(call) @@ -240,7 +240,7 @@ async def async_setup_entry(hass, config_entry): """Decorate.""" system = simplisafe.systems[int(call.data[ATTR_SYSTEM_ID])] if system.version != 3: - LOGGER.error("Service only available on V3 systems") + _LOGGER.error("Service only available on V3 systems") return await coro(call) @@ -254,7 +254,7 @@ async def async_setup_entry(hass, config_entry): try: await system.clear_notifications() except SimplipyError as err: - LOGGER.error("Error during service call: %s", err) + _LOGGER.error("Error during service call: %s", err) return @verify_system_exists @@ -265,7 +265,7 @@ async def async_setup_entry(hass, config_entry): try: await system.remove_pin(call.data[ATTR_PIN_LABEL_OR_VALUE]) except SimplipyError as err: - LOGGER.error("Error during service call: %s", err) + _LOGGER.error("Error during service call: %s", err) return @verify_system_exists @@ -276,7 +276,7 @@ async def async_setup_entry(hass, config_entry): try: await system.set_pin(call.data[ATTR_PIN_LABEL], call.data[ATTR_PIN_VALUE]) except SimplipyError as err: - LOGGER.error("Error during service call: %s", err) + _LOGGER.error("Error during service call: %s", err) return @verify_system_exists @@ -294,7 +294,7 @@ async def async_setup_entry(hass, config_entry): } ) except SimplipyError as err: - LOGGER.error("Error during service call: %s", err) + _LOGGER.error("Error during service call: %s", err) return for service, method, schema in [ @@ -349,16 +349,16 @@ class SimpliSafeWebsocket: @staticmethod def _on_connect(): """Define a handler to fire when the websocket is connected.""" - LOGGER.info("Connected to websocket") + _LOGGER.info("Connected to websocket") @staticmethod def _on_disconnect(): """Define a handler to fire when the websocket is disconnected.""" - LOGGER.info("Disconnected from websocket") + _LOGGER.info("Disconnected from websocket") def _on_event(self, event): """Define a handler to fire when a new SimpliSafe event arrives.""" - LOGGER.debug("New websocket event: %s", event) + _LOGGER.debug("New websocket event: %s", event) async_dispatcher_send( self._hass, TOPIC_UPDATE_WEBSOCKET.format(event.system_id), event ) @@ -430,7 +430,7 @@ class SimpliSafe: if not to_add: return - LOGGER.debug("New system notifications: %s", to_add) + _LOGGER.debug("New system notifications: %s", to_add) self._system_notifications[system.system_id].update(to_add) @@ -481,7 +481,7 @@ class SimpliSafe: system.system_id ] = await system.get_latest_event() except SimplipyError as err: - LOGGER.error("Error while fetching initial event: %s", err) + _LOGGER.error("Error while fetching initial event: %s", err) self.initial_event_to_use[system.system_id] = {} async def refresh(event_time): @@ -501,7 +501,7 @@ class SimpliSafe: """Update a system.""" await system.update(cached=False) self._async_process_new_notifications(system) - LOGGER.debug('Updated REST API data for "%s"', system.address) + _LOGGER.debug('Updated REST API data for "%s"', system.address) async_dispatcher_send( self._hass, TOPIC_UPDATE_REST_API.format(system.system_id) ) @@ -534,7 +534,7 @@ class SimpliSafe: return - LOGGER.warning("SimpliSafe cloud error; trying stored refresh token") + _LOGGER.warning("SimpliSafe cloud error; trying stored refresh token") self._emergency_refresh_token_used = True try: @@ -543,22 +543,22 @@ class SimpliSafe: ) return except SimplipyError as err: - LOGGER.error("Error while using stored refresh token: %s", err) + _LOGGER.error("Error while using stored refresh token: %s", err) return if isinstance(result, EndpointUnavailable): # In case the user attempt an action not allowed in their current plan, # we merely log that message at INFO level (so the user is aware, # but not spammed with ERROR messages that they cannot change): - LOGGER.info(result) + _LOGGER.info(result) return if isinstance(result, SimplipyError): - LOGGER.error("SimpliSafe error while updating: %s", result) + _LOGGER.error("SimpliSafe error while updating: %s", result) return if isinstance(result, Exception): - LOGGER.error("Unknown error while updating: %s", result) + _LOGGER.error("Unknown error while updating: %s", result) return if self._api.refresh_token != self.config_entry.data[CONF_TOKEN]: diff --git a/homeassistant/components/simplisafe/alarm_control_panel.py b/homeassistant/components/simplisafe/alarm_control_panel.py index 11f794eef5d..ef6781d14b3 100644 --- a/homeassistant/components/simplisafe/alarm_control_panel.py +++ b/homeassistant/components/simplisafe/alarm_control_panel.py @@ -38,6 +38,7 @@ from homeassistant.core import callback from . import SimpliSafeEntity from .const import ( + _LOGGER, ATTR_ALARM_DURATION, ATTR_ALARM_VOLUME, ATTR_CHIME_VOLUME, @@ -49,7 +50,6 @@ from .const import ( ATTR_VOICE_PROMPT_VOLUME, DATA_CLIENT, DOMAIN, - LOGGER, VOLUME_STRING_MAP, ) @@ -144,7 +144,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity): return True if not code or code != self._simplisafe.config_entry.options[CONF_CODE]: - LOGGER.warning( + _LOGGER.warning( "Incorrect alarm code entered (target state: %s): %s", state, code ) return False @@ -159,7 +159,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity): try: await self._system.set_off() except SimplipyError as err: - LOGGER.error('Error while disarming "%s": %s', self._system.name, err) + _LOGGER.error('Error while disarming "%s": %s', self._system.name, err) return self._state = STATE_ALARM_DISARMED @@ -172,7 +172,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity): try: await self._system.set_home() except SimplipyError as err: - LOGGER.error('Error while arming "%s" (home): %s', self._system.name, err) + _LOGGER.error('Error while arming "%s" (home): %s', self._system.name, err) return self._state = STATE_ALARM_ARMED_HOME @@ -185,7 +185,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity): try: await self._system.set_away() except SimplipyError as err: - LOGGER.error('Error while arming "%s" (away): %s', self._system.name, err) + _LOGGER.error('Error while arming "%s" (away): %s', self._system.name, err) return self._state = STATE_ALARM_ARMING diff --git a/homeassistant/components/simplisafe/config_flow.py b/homeassistant/components/simplisafe/config_flow.py index 0437c309039..234eeb63288 100644 --- a/homeassistant/components/simplisafe/config_flow.py +++ b/homeassistant/components/simplisafe/config_flow.py @@ -13,7 +13,7 @@ from homeassistant.core import callback from homeassistant.helpers import aiohttp_client from . import async_get_client_id -from .const import DOMAIN, LOGGER # pylint: disable=unused-import +from .const import _LOGGER, DOMAIN # pylint: disable=unused-import class SimpliSafeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): @@ -62,12 +62,12 @@ class SimpliSafeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): try: simplisafe = await self._async_get_simplisafe_api() except PendingAuthorizationError: - LOGGER.info("Awaiting confirmation of MFA email click") + _LOGGER.info("Awaiting confirmation of MFA email click") return await self.async_step_mfa() except InvalidCredentialsError: errors = {"base": "invalid_credentials"} except SimplipyError as err: - LOGGER.error("Unknown error while logging into SimpliSafe: %s", err) + _LOGGER.error("Unknown error while logging into SimpliSafe: %s", err) errors = {"base": "unknown"} if errors: @@ -101,7 +101,7 @@ class SimpliSafeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): try: simplisafe = await self._async_get_simplisafe_api() except PendingAuthorizationError: - LOGGER.error("Still awaiting confirmation of MFA email click") + _LOGGER.error("Still awaiting confirmation of MFA email click") return self.async_show_form( step_id="mfa", errors={"base": "still_awaiting_mfa"} ) diff --git a/homeassistant/components/simplisafe/const.py b/homeassistant/components/simplisafe/const.py index 36d191d0ab8..884afdcfa37 100644 --- a/homeassistant/components/simplisafe/const.py +++ b/homeassistant/components/simplisafe/const.py @@ -4,7 +4,7 @@ import logging from simplipy.system.v3 import VOLUME_HIGH, VOLUME_LOW, VOLUME_MEDIUM, VOLUME_OFF -LOGGER = logging.getLogger(__package__) +_LOGGER = logging.getLogger(__package__) DOMAIN = "simplisafe" diff --git a/homeassistant/components/simplisafe/lock.py b/homeassistant/components/simplisafe/lock.py index 82177fb4387..cb4ca9b88ca 100644 --- a/homeassistant/components/simplisafe/lock.py +++ b/homeassistant/components/simplisafe/lock.py @@ -7,7 +7,7 @@ from homeassistant.components.lock import LockEntity from homeassistant.core import callback from . import SimpliSafeEntity -from .const import DATA_CLIENT, DOMAIN, LOGGER +from .const import _LOGGER, DATA_CLIENT, DOMAIN ATTR_LOCK_LOW_BATTERY = "lock_low_battery" ATTR_JAMMED = "jammed" @@ -48,7 +48,7 @@ class SimpliSafeLock(SimpliSafeEntity, LockEntity): try: await self._lock.lock() except SimplipyError as err: - LOGGER.error('Error while locking "%s": %s', self._lock.name, err) + _LOGGER.error('Error while locking "%s": %s', self._lock.name, err) return self._is_locked = True @@ -58,7 +58,7 @@ class SimpliSafeLock(SimpliSafeEntity, LockEntity): try: await self._lock.unlock() except SimplipyError as err: - LOGGER.error('Error while unlocking "%s": %s', self._lock.name, err) + _LOGGER.error('Error while unlocking "%s": %s', self._lock.name, err) return self._is_locked = False diff --git a/homeassistant/components/simulated/sensor.py b/homeassistant/components/simulated/sensor.py index fba8b497d51..7f484b712c1 100644 --- a/homeassistant/components/simulated/sensor.py +++ b/homeassistant/components/simulated/sensor.py @@ -1,6 +1,5 @@ """Adds a simulated sensor.""" from datetime import datetime -import logging import math from random import Random @@ -12,8 +11,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity import homeassistant.util.dt as dt_util -_LOGGER = logging.getLogger(__name__) - CONF_AMP = "amplitude" CONF_FWHM = "spread" CONF_MEAN = "mean" diff --git a/homeassistant/components/sisyphus/media_player.py b/homeassistant/components/sisyphus/media_player.py index 27d470ce885..8f55fce1178 100644 --- a/homeassistant/components/sisyphus/media_player.py +++ b/homeassistant/components/sisyphus/media_player.py @@ -1,6 +1,4 @@ """Support for track controls on the Sisyphus Kinetic Art Table.""" -import logging - import aiohttp from sisyphus_control import Track @@ -27,8 +25,6 @@ from homeassistant.exceptions import PlatformNotReady from . import DATA_SISYPHUS -_LOGGER = logging.getLogger(__name__) - MEDIA_TYPE_TRACK = "sisyphus_track" SUPPORTED_FEATURES = ( diff --git a/homeassistant/components/skybell/binary_sensor.py b/homeassistant/components/skybell/binary_sensor.py index 94f64a4eb43..512731ab355 100644 --- a/homeassistant/components/skybell/binary_sensor.py +++ b/homeassistant/components/skybell/binary_sensor.py @@ -1,6 +1,5 @@ """Binary sensor support for the Skybell HD Doorbell.""" from datetime import timedelta -import logging import voluptuous as vol @@ -15,8 +14,6 @@ import homeassistant.helpers.config_validation as cv from . import DEFAULT_ENTITY_NAMESPACE, DOMAIN as SKYBELL_DOMAIN, SkybellDevice -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = timedelta(seconds=5) # Sensor types: Name, device_class, event diff --git a/homeassistant/components/skybell/light.py b/homeassistant/components/skybell/light.py index 273cdfd079c..aecaea01d2a 100644 --- a/homeassistant/components/skybell/light.py +++ b/homeassistant/components/skybell/light.py @@ -1,6 +1,4 @@ """Light/LED support for the Skybell HD Doorbell.""" -import logging - from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, @@ -12,8 +10,6 @@ import homeassistant.util.color as color_util from . import DOMAIN as SKYBELL_DOMAIN, SkybellDevice -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the platform for a Skybell device.""" diff --git a/homeassistant/components/skybell/sensor.py b/homeassistant/components/skybell/sensor.py index 24b63b6271c..09a7400a035 100644 --- a/homeassistant/components/skybell/sensor.py +++ b/homeassistant/components/skybell/sensor.py @@ -1,6 +1,5 @@ """Sensor support for Skybell Doorbells.""" from datetime import timedelta -import logging import voluptuous as vol @@ -10,8 +9,6 @@ import homeassistant.helpers.config_validation as cv from . import DEFAULT_ENTITY_NAMESPACE, DOMAIN as SKYBELL_DOMAIN, SkybellDevice -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = timedelta(seconds=30) # Sensor types: Name, icon diff --git a/homeassistant/components/skybell/switch.py b/homeassistant/components/skybell/switch.py index 97a1d2a4c00..3d1d890b295 100644 --- a/homeassistant/components/skybell/switch.py +++ b/homeassistant/components/skybell/switch.py @@ -1,6 +1,4 @@ """Switch support for the Skybell HD Doorbell.""" -import logging - import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -9,8 +7,6 @@ import homeassistant.helpers.config_validation as cv from . import DEFAULT_ENTITY_NAMESPACE, DOMAIN as SKYBELL_DOMAIN, SkybellDevice -_LOGGER = logging.getLogger(__name__) - # Switch types: Name SWITCH_TYPES = { "do_not_disturb": ["Do Not Disturb"], diff --git a/homeassistant/components/smappee/binary_sensor.py b/homeassistant/components/smappee/binary_sensor.py index 49d21f2b2c1..4cc5cca9a23 100644 --- a/homeassistant/components/smappee/binary_sensor.py +++ b/homeassistant/components/smappee/binary_sensor.py @@ -1,6 +1,4 @@ """Support for monitoring a Smappee appliance binary sensor.""" -import logging - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_PRESENCE, BinarySensorEntity, @@ -8,8 +6,6 @@ from homeassistant.components.binary_sensor import ( from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - BINARY_SENSOR_PREFIX = "Appliance" PRESENCE_PREFIX = "Presence" diff --git a/homeassistant/components/smappee/config_flow.py b/homeassistant/components/smappee/config_flow.py index a31dac6912e..c6d208626e4 100644 --- a/homeassistant/components/smappee/config_flow.py +++ b/homeassistant/components/smappee/config_flow.py @@ -17,8 +17,6 @@ from .const import ( SUPPORTED_LOCAL_DEVICES, ) -_LOGGER = logging.getLogger(__name__) - class SmappeeFlowHandler( config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN diff --git a/homeassistant/components/smappee/sensor.py b/homeassistant/components/smappee/sensor.py index dd145c4cdce..41041c1a002 100644 --- a/homeassistant/components/smappee/sensor.py +++ b/homeassistant/components/smappee/sensor.py @@ -1,13 +1,9 @@ """Support for monitoring a Smappee energy sensor.""" -import logging - from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_WATT_HOUR, POWER_WATT, VOLT from homeassistant.helpers.entity import Entity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - TREND_SENSORS = { "total_power": [ "Total consumption - Active power", diff --git a/homeassistant/components/smappee/switch.py b/homeassistant/components/smappee/switch.py index bbcacc7d541..46322f413e9 100644 --- a/homeassistant/components/smappee/switch.py +++ b/homeassistant/components/smappee/switch.py @@ -1,12 +1,8 @@ """Support for interacting with Smappee Comport Plugs, Switches and Output Modules.""" -import logging - from homeassistant.components.switch import SwitchEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - SWITCH_PREFIX = "Switch" ICON = "mdi:toggle-switch" diff --git a/homeassistant/components/smart_meter_texas/sensor.py b/homeassistant/components/smart_meter_texas/sensor.py index c08301d7021..e65fbdcb531 100644 --- a/homeassistant/components/smart_meter_texas/sensor.py +++ b/homeassistant/components/smart_meter_texas/sensor.py @@ -1,6 +1,4 @@ """Support for Smart Meter Texas sensors.""" -import logging - from smart_meter_texas import Meter from homeassistant.const import CONF_ADDRESS, ENERGY_KILO_WATT_HOUR @@ -20,8 +18,6 @@ from .const import ( METER_NUMBER, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Smart Meter Texas sensors.""" diff --git a/homeassistant/components/smhi/const.py b/homeassistant/components/smhi/const.py index a5a97503194..7e88f95f691 100644 --- a/homeassistant/components/smhi/const.py +++ b/homeassistant/components/smhi/const.py @@ -1,6 +1,4 @@ """Constants in smhi component.""" -import logging - from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN ATTR_SMHI_CLOUDINESS = "cloudiness" @@ -11,5 +9,3 @@ HOME_LOCATION_NAME = "Home" ENTITY_ID_SENSOR_FORMAT = WEATHER_DOMAIN + ".smhi_{}" ENTITY_ID_SENSOR_FORMAT_HOME = ENTITY_ID_SENSOR_FORMAT.format(HOME_LOCATION_NAME) - -LOGGER = logging.getLogger(__package__) diff --git a/homeassistant/components/sms/__init__.py b/homeassistant/components/sms/__init__.py index b1af205fc10..8752dfd90da 100644 --- a/homeassistant/components/sms/__init__.py +++ b/homeassistant/components/sms/__init__.py @@ -1,6 +1,5 @@ """The sms component.""" import asyncio -import logging import voluptuous as vol @@ -12,8 +11,6 @@ from homeassistant.helpers import config_validation as cv from .const import DOMAIN, SMS_GATEWAY from .gateway import create_sms_gateway -_LOGGER = logging.getLogger(__name__) - PLATFORMS = ["sensor"] CONFIG_SCHEMA = vol.Schema( diff --git a/homeassistant/components/sochain/sensor.py b/homeassistant/components/sochain/sensor.py index 608405dd1b4..8f704471339 100644 --- a/homeassistant/components/sochain/sensor.py +++ b/homeassistant/components/sochain/sensor.py @@ -1,6 +1,5 @@ """Support for watching multiple cryptocurrencies.""" from datetime import timedelta -import logging from pysochain import ChainSo import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - ATTRIBUTION = "Data provided by chain.so" CONF_NETWORK = "network" diff --git a/homeassistant/components/solax/sensor.py b/homeassistant/components/solax/sensor.py index 3084aefd97c..bca507c4391 100644 --- a/homeassistant/components/solax/sensor.py +++ b/homeassistant/components/solax/sensor.py @@ -1,7 +1,6 @@ """Support for Solax inverter via local API.""" import asyncio from datetime import timedelta -import logging from solax import real_time_api from solax.inverter import InverterError @@ -14,8 +13,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.event import async_track_time_interval -_LOGGER = logging.getLogger(__name__) - DEFAULT_PORT = 80 PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/somfy/config_flow.py b/homeassistant/components/somfy/config_flow.py index 80fc2192d8e..5e7b5793977 100644 --- a/homeassistant/components/somfy/config_flow.py +++ b/homeassistant/components/somfy/config_flow.py @@ -6,8 +6,6 @@ from homeassistant.helpers import config_entry_oauth2_flow from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - @config_entries.HANDLERS.register(DOMAIN) class SomfyFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): diff --git a/homeassistant/components/somfy_mylink/__init__.py b/homeassistant/components/somfy_mylink/__init__.py index 6c6333af5a6..8106cde0c18 100644 --- a/homeassistant/components/somfy_mylink/__init__.py +++ b/homeassistant/components/somfy_mylink/__init__.py @@ -1,6 +1,4 @@ """Component for the Somfy MyLink device supporting the Synergy API.""" -import logging - from somfy_mylink_synergy import SomfyMyLinkSynergy import voluptuous as vol @@ -8,7 +6,6 @@ from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.helpers import config_validation as cv from homeassistant.helpers.discovery import async_load_platform -_LOGGER = logging.getLogger(__name__) CONF_ENTITY_CONFIG = "entity_config" CONF_SYSTEM_ID = "system_id" CONF_REVERSE = "reverse" diff --git a/homeassistant/components/songpal/__init__.py b/homeassistant/components/songpal/__init__.py index 493a3ef4913..d6e31fb9a1c 100644 --- a/homeassistant/components/songpal/__init__.py +++ b/homeassistant/components/songpal/__init__.py @@ -1,6 +1,5 @@ """The songpal component.""" from collections import OrderedDict -import logging import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.helpers.typing import HomeAssistantType from .const import CONF_ENDPOINT, DOMAIN -_LOGGER = logging.getLogger(__name__) - SONGPAL_CONFIG_SCHEMA = vol.Schema( {vol.Optional(CONF_NAME): cv.string, vol.Required(CONF_ENDPOINT): cv.string} ) diff --git a/homeassistant/components/spaceapi/__init__.py b/homeassistant/components/spaceapi/__init__.py index ea5a64d97e7..571e0ab62f3 100644 --- a/homeassistant/components/spaceapi/__init__.py +++ b/homeassistant/components/spaceapi/__init__.py @@ -1,6 +1,4 @@ """Support for the SpaceAPI.""" -import logging - import voluptuous as vol from homeassistant.components.http import HomeAssistantView @@ -21,8 +19,6 @@ import homeassistant.core as ha import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util -_LOGGER = logging.getLogger(__name__) - ATTR_ADDRESS = "address" ATTR_SPACEFED = "spacefed" ATTR_CAM = "cam" diff --git a/homeassistant/components/spc/alarm_control_panel.py b/homeassistant/components/spc/alarm_control_panel.py index 86adc588038..d2d082b08b0 100644 --- a/homeassistant/components/spc/alarm_control_panel.py +++ b/homeassistant/components/spc/alarm_control_panel.py @@ -1,6 +1,4 @@ """Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" -import logging - from pyspcwebgw.const import AreaMode import homeassistant.components.alarm_control_panel as alarm @@ -21,8 +19,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import DATA_API, SIGNAL_UPDATE_ALARM -_LOGGER = logging.getLogger(__name__) - def _get_alarm_state(area): """Get the alarm state.""" diff --git a/homeassistant/components/spc/binary_sensor.py b/homeassistant/components/spc/binary_sensor.py index 1fda59207ec..48023d09a99 100644 --- a/homeassistant/components/spc/binary_sensor.py +++ b/homeassistant/components/spc/binary_sensor.py @@ -1,6 +1,4 @@ """Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" -import logging - from pyspcwebgw.const import ZoneInput, ZoneType from homeassistant.components.binary_sensor import ( @@ -14,8 +12,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import DATA_API, SIGNAL_UPDATE_SENSOR -_LOGGER = logging.getLogger(__name__) - def _get_device_class(zone_type): return { diff --git a/homeassistant/components/spider/climate.py b/homeassistant/components/spider/climate.py index 015606286e2..d9477c2a4fb 100644 --- a/homeassistant/components/spider/climate.py +++ b/homeassistant/components/spider/climate.py @@ -1,7 +1,4 @@ """Support for Spider thermostats.""" - -import logging - from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( HVAC_MODE_COOL, @@ -26,8 +23,6 @@ HA_STATE_TO_SPIDER = { SPIDER_STATE_TO_HA = {value: key for key, value in HA_STATE_TO_SPIDER.items()} -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config, async_add_entities): """Initialize a Spider thermostat.""" diff --git a/homeassistant/components/spider/switch.py b/homeassistant/components/spider/switch.py index cea20d8c6be..62f220bf805 100644 --- a/homeassistant/components/spider/switch.py +++ b/homeassistant/components/spider/switch.py @@ -1,12 +1,8 @@ """Support for Spider switches.""" -import logging - from homeassistant.components.switch import SwitchEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config, async_add_entities): """Initialize a Spider thermostat.""" diff --git a/homeassistant/components/spotcrime/sensor.py b/homeassistant/components/spotcrime/sensor.py index 2edaa3cf933..30aa80b5e7d 100644 --- a/homeassistant/components/spotcrime/sensor.py +++ b/homeassistant/components/spotcrime/sensor.py @@ -2,7 +2,6 @@ from collections import defaultdict from datetime import timedelta -import logging import spotcrime import voluptuous as vol @@ -24,8 +23,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import slugify -_LOGGER = logging.getLogger(__name__) - CONF_DAYS = "days" DEFAULT_DAYS = 1 NAME = "spotcrime" diff --git a/homeassistant/components/spotify/config_flow.py b/homeassistant/components/spotify/config_flow.py index 14e45d58b39..ac6e101d4fe 100644 --- a/homeassistant/components/spotify/config_flow.py +++ b/homeassistant/components/spotify/config_flow.py @@ -11,8 +11,6 @@ from homeassistant.helpers import config_entry_oauth2_flow from .const import DOMAIN, SPOTIFY_SCOPES -_LOGGER = logging.getLogger(__name__) - class SpotifyFlowHandler( config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN diff --git a/homeassistant/components/starline/account.py b/homeassistant/components/starline/account.py index 3ee716ec856..1cedcef8e84 100644 --- a/homeassistant/components/starline/account.py +++ b/homeassistant/components/starline/account.py @@ -9,13 +9,13 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.event import async_track_time_interval from .const import ( + _LOGGER, DATA_EXPIRES, DATA_SLID_TOKEN, DATA_SLNET_TOKEN, DATA_USER_ID, DEFAULT_SCAN_INTERVAL, DOMAIN, - LOGGER, ) @@ -60,7 +60,7 @@ class StarlineAccount: }, ) except Exception as err: # pylint: disable=broad-except - LOGGER.error("Error updating SLNet token: %s", err) + _LOGGER.error("Error updating SLNet token: %s", err) def _update_data(self): """Update StarLine data.""" @@ -78,7 +78,7 @@ class StarlineAccount: def set_update_interval(self, interval: int) -> None: """Set StarLine API update interval.""" - LOGGER.debug("Setting update interval: %ds", interval) + _LOGGER.debug("Setting update interval: %ds", interval) self._update_interval = interval if self._unsubscribe_auto_updater is not None: self._unsubscribe_auto_updater() @@ -90,7 +90,7 @@ class StarlineAccount: def unload(self): """Unload StarLine API.""" - LOGGER.debug("Unloading StarLine API.") + _LOGGER.debug("Unloading StarLine API.") if self._unsubscribe_auto_updater is not None: self._unsubscribe_auto_updater() self._unsubscribe_auto_updater = None diff --git a/homeassistant/components/starline/config_flow.py b/homeassistant/components/starline/config_flow.py index 8650f158cfc..d6e8d6f98ea 100644 --- a/homeassistant/components/starline/config_flow.py +++ b/homeassistant/components/starline/config_flow.py @@ -8,6 +8,7 @@ from homeassistant import config_entries, core from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from .const import ( # pylint: disable=unused-import + _LOGGER, CONF_APP_ID, CONF_APP_SECRET, CONF_CAPTCHA_CODE, @@ -20,7 +21,6 @@ from .const import ( # pylint: disable=unused-import ERROR_AUTH_APP, ERROR_AUTH_MFA, ERROR_AUTH_USER, - LOGGER, ) @@ -182,7 +182,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ) return self._async_form_auth_user(error) except Exception as err: # pylint: disable=broad-except - LOGGER.error("Error auth StarLine: %s", err) + _LOGGER.error("Error auth StarLine: %s", err) return self._async_form_auth_app(ERROR_AUTH_APP) async def _async_authenticate_user(self, error=None): @@ -215,7 +215,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): raise Exception(data) except Exception as err: # pylint: disable=broad-except - LOGGER.error("Error auth user: %s", err) + _LOGGER.error("Error auth user: %s", err) return self._async_form_auth_user(ERROR_AUTH_USER) async def _async_get_entry(self): diff --git a/homeassistant/components/starline/const.py b/homeassistant/components/starline/const.py index d76cd47b100..64ba8fc3d2d 100644 --- a/homeassistant/components/starline/const.py +++ b/homeassistant/components/starline/const.py @@ -1,7 +1,7 @@ """StarLine constants.""" import logging -LOGGER = logging.getLogger(__package__) +_LOGGER = logging.getLogger(__package__) DOMAIN = "starline" PLATFORMS = ["device_tracker", "binary_sensor", "sensor", "lock", "switch"] diff --git a/homeassistant/components/stookalert/binary_sensor.py b/homeassistant/components/stookalert/binary_sensor.py index aa792d10653..a1c36e9a10e 100644 --- a/homeassistant/components/stookalert/binary_sensor.py +++ b/homeassistant/components/stookalert/binary_sensor.py @@ -1,6 +1,5 @@ """This component provides support for Stookalert Binary Sensor.""" from datetime import timedelta -import logging import stookalert import voluptuous as vol @@ -13,8 +12,6 @@ from homeassistant.components.binary_sensor import ( from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME from homeassistant.helpers import config_validation as cv -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = timedelta(minutes=60) CONF_PROVINCE = "province" DEFAULT_DEVICE_CLASS = DEVICE_CLASS_SAFETY diff --git a/homeassistant/components/sun/trigger.py b/homeassistant/components/sun/trigger.py index 756a73fc2b0..779d3078f13 100644 --- a/homeassistant/components/sun/trigger.py +++ b/homeassistant/components/sun/trigger.py @@ -1,6 +1,5 @@ """Offer sun based automation rules.""" from datetime import timedelta -import logging import voluptuous as vol @@ -16,8 +15,6 @@ from homeassistant.helpers.event import async_track_sunrise, async_track_sunset # mypy: allow-untyped-defs, no-check-untyped-defs -_LOGGER = logging.getLogger(__name__) - TRIGGER_SCHEMA = vol.Schema( { vol.Required(CONF_PLATFORM): "sun", diff --git a/homeassistant/components/switch/light.py b/homeassistant/components/switch/light.py index c9dd3553928..5128a49d8b7 100644 --- a/homeassistant/components/switch/light.py +++ b/homeassistant/components/switch/light.py @@ -1,5 +1,4 @@ """Light support for switch entities.""" -import logging from typing import Any, Callable, Optional, Sequence, cast import voluptuous as vol @@ -25,8 +24,6 @@ from homeassistant.helpers.typing import ( # mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "Light Switch" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/switchbot/switch.py b/homeassistant/components/switchbot/switch.py index 6d32f8cfd10..3dd931abe49 100644 --- a/homeassistant/components/switchbot/switch.py +++ b/homeassistant/components/switchbot/switch.py @@ -1,5 +1,4 @@ """Support for Switchbot.""" -import logging from typing import Any, Dict # pylint: disable=import-error, no-member @@ -11,8 +10,6 @@ from homeassistant.const import CONF_MAC, CONF_NAME, CONF_PASSWORD import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "Switchbot" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( diff --git a/homeassistant/components/switcher_kis/__init__.py b/homeassistant/components/switcher_kis/__init__.py index 4a9a564ec3b..23b69eefb74 100644 --- a/homeassistant/components/switcher_kis/__init__.py +++ b/homeassistant/components/switcher_kis/__init__.py @@ -1,8 +1,7 @@ """Home Assistant Switcher Component.""" - from asyncio import QueueEmpty, TimeoutError as Asyncio_TimeoutError, wait_for from datetime import datetime, timedelta -from logging import getLogger +import logging from typing import Dict, Optional from aioswitcher.api import SwitcherV2Api @@ -28,7 +27,7 @@ from homeassistant.helpers.typing import ( ) from homeassistant.loader import bind_hass -_LOGGER = getLogger(__name__) +_LOGGER = logging.getLogger(__name__) DOMAIN = "switcher_kis" diff --git a/homeassistant/components/switcher_kis/switch.py b/homeassistant/components/switcher_kis/switch.py index badab64391e..af922c3ab8b 100644 --- a/homeassistant/components/switcher_kis/switch.py +++ b/homeassistant/components/switcher_kis/switch.py @@ -1,6 +1,4 @@ """Home Assistant Switcher Component Switch platform.""" - -from logging import getLogger from typing import TYPE_CHECKING, Callable, Dict from aioswitcher.api import SwitcherV2Api @@ -31,8 +29,6 @@ if TYPE_CHECKING: from aioswitcher.devices import SwitcherV2Device -_LOGGER = getLogger(__name__) - DEVICE_PROPERTIES_TO_HA_ATTRIBUTES = { "power_consumption": ATTR_CURRENT_POWER_W, "electric_current": ATTR_ELECTRIC_CURRENT, diff --git a/homeassistant/components/switchmate/switch.py b/homeassistant/components/switchmate/switch.py index e09e42fe75b..a052b9051a1 100644 --- a/homeassistant/components/switchmate/switch.py +++ b/homeassistant/components/switchmate/switch.py @@ -1,6 +1,5 @@ """Support for Switchmate.""" from datetime import timedelta -import logging # pylint: disable=import-error, no-member import switchmate @@ -10,8 +9,6 @@ from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import CONF_MAC, CONF_NAME import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_FLIP_ON_OFF = "flip_on_off" DEFAULT_NAME = "Switchmate" diff --git a/homeassistant/components/syslog/notify.py b/homeassistant/components/syslog/notify.py index 67d4882e5c3..8ace605a0f5 100644 --- a/homeassistant/components/syslog/notify.py +++ b/homeassistant/components/syslog/notify.py @@ -1,5 +1,4 @@ """Syslog notification service.""" -import logging import syslog import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.components.notify import ( BaseNotificationService, ) -_LOGGER = logging.getLogger(__name__) - CONF_FACILITY = "facility" CONF_OPTION = "option" CONF_PRIORITY = "priority" diff --git a/homeassistant/components/tado/entity.py b/homeassistant/components/tado/entity.py index 97a3e3bdc39..d91896a4e12 100644 --- a/homeassistant/components/tado/entity.py +++ b/homeassistant/components/tado/entity.py @@ -1,13 +1,8 @@ """Base class for August entity.""" - -import logging - from homeassistant.helpers.entity import Entity from .const import DEFAULT_NAME, DOMAIN -_LOGGER = logging.getLogger(__name__) - class TadoZoneEntity(Entity): """Base implementation for tado device.""" diff --git a/homeassistant/components/tahoma/scene.py b/homeassistant/components/tahoma/scene.py index 55b89dfcd47..1d53b65d5d5 100644 --- a/homeassistant/components/tahoma/scene.py +++ b/homeassistant/components/tahoma/scene.py @@ -1,13 +1,10 @@ """Support for Tahoma scenes.""" -import logging from typing import Any from homeassistant.components.scene import Scene from . import DOMAIN as TAHOMA_DOMAIN -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Tahoma scenes.""" diff --git a/homeassistant/components/tasmota/binary_sensor.py b/homeassistant/components/tasmota/binary_sensor.py index 4e32ed25194..549452c1949 100644 --- a/homeassistant/components/tasmota/binary_sensor.py +++ b/homeassistant/components/tasmota/binary_sensor.py @@ -1,5 +1,4 @@ """Support for Tasmota binary sensors.""" -import logging from homeassistant.components import binary_sensor from homeassistant.components.binary_sensor import BinarySensorEntity @@ -11,8 +10,6 @@ from .const import DOMAIN as TASMOTA_DOMAIN from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Tasmota binary sensor dynamically through discovery.""" diff --git a/homeassistant/components/tasmota/config_flow.py b/homeassistant/components/tasmota/config_flow.py index 397e735ae5d..5d39fa02438 100644 --- a/homeassistant/components/tasmota/config_flow.py +++ b/homeassistant/components/tasmota/config_flow.py @@ -1,6 +1,4 @@ """Config flow for Tasmota.""" -import logging - import voluptuous as vol from homeassistant import config_entries @@ -12,8 +10,6 @@ from .const import ( # pylint:disable=unused-import DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Handle a config flow.""" diff --git a/homeassistant/components/tasmota/device_automation.py b/homeassistant/components/tasmota/device_automation.py index bc788bb3f09..6bbd8ce6d89 100644 --- a/homeassistant/components/tasmota/device_automation.py +++ b/homeassistant/components/tasmota/device_automation.py @@ -1,5 +1,4 @@ """Provides device automations for Tasmota.""" -import logging from hatasmota.const import AUTOMATION_TYPE_TRIGGER @@ -9,8 +8,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import device_trigger from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry): """Set up Tasmota device automation dynamically through discovery.""" diff --git a/homeassistant/components/tasmota/light.py b/homeassistant/components/tasmota/light.py index b0993e3cdfc..00cedc4a611 100644 --- a/homeassistant/components/tasmota/light.py +++ b/homeassistant/components/tasmota/light.py @@ -1,6 +1,4 @@ """Support for Tasmota lights.""" -import logging - from hatasmota.light import ( LIGHT_TYPE_COLDWARM, LIGHT_TYPE_NONE, @@ -33,8 +31,6 @@ from .const import DOMAIN as TASMOTA_DOMAIN from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate -_LOGGER = logging.getLogger(__name__) - DEFAULT_BRIGHTNESS_MAX = 255 TASMOTA_BRIGHTNESS_MAX = 100 diff --git a/homeassistant/components/tasmota/sensor.py b/homeassistant/components/tasmota/sensor.py index 690a845d780..189aa5731b3 100644 --- a/homeassistant/components/tasmota/sensor.py +++ b/homeassistant/components/tasmota/sensor.py @@ -1,5 +1,4 @@ """Support for Tasmota sensors.""" -import logging from typing import Optional from hatasmota.const import ( @@ -60,8 +59,6 @@ from .const import DOMAIN as TASMOTA_DOMAIN from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate -_LOGGER = logging.getLogger(__name__) - DEVICE_CLASS = "device_class" ICON = "icon" diff --git a/homeassistant/components/tasmota/switch.py b/homeassistant/components/tasmota/switch.py index 2477d5888a7..fe8f4b9555c 100644 --- a/homeassistant/components/tasmota/switch.py +++ b/homeassistant/components/tasmota/switch.py @@ -1,5 +1,4 @@ """Support for Tasmota switches.""" -import logging from homeassistant.components import switch from homeassistant.components.switch import SwitchEntity @@ -10,8 +9,6 @@ from .const import DOMAIN as TASMOTA_DOMAIN from .discovery import TASMOTA_DISCOVERY_ENTITY_NEW from .mixins import TasmotaAvailability, TasmotaDiscoveryUpdate -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Tasmota switch dynamically through discovery.""" diff --git a/homeassistant/components/tautulli/sensor.py b/homeassistant/components/tautulli/sensor.py index 3c61559bcfa..ed96bb62ace 100644 --- a/homeassistant/components/tautulli/sensor.py +++ b/homeassistant/components/tautulli/sensor.py @@ -1,6 +1,5 @@ """A platform which allows you to get information from Tautulli.""" from datetime import timedelta -import logging from pytautulli import Tautulli import voluptuous as vol @@ -22,8 +21,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -_LOGGER = logging.getLogger(__name__) - CONF_MONITORED_USERS = "monitored_users" DEFAULT_NAME = "Tautulli" diff --git a/homeassistant/components/tcp/binary_sensor.py b/homeassistant/components/tcp/binary_sensor.py index 1648ab5e247..5437cef02de 100644 --- a/homeassistant/components/tcp/binary_sensor.py +++ b/homeassistant/components/tcp/binary_sensor.py @@ -1,12 +1,8 @@ """Provides a binary sensor which gets its values from a TCP socket.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from .sensor import CONF_VALUE_ON, PLATFORM_SCHEMA, TcpSensor -_LOGGER = logging.getLogger(__name__) - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({}) diff --git a/homeassistant/components/tellduslive/binary_sensor.py b/homeassistant/components/tellduslive/binary_sensor.py index 3f829365689..45a49e2c1fb 100644 --- a/homeassistant/components/tellduslive/binary_sensor.py +++ b/homeassistant/components/tellduslive/binary_sensor.py @@ -1,14 +1,10 @@ """Support for binary sensors using Tellstick Net.""" -import logging - from homeassistant.components import binary_sensor, tellduslive from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.helpers.dispatcher import async_dispatcher_connect from .entry import TelldusLiveEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up tellduslive sensors dynamically.""" diff --git a/homeassistant/components/tellduslive/cover.py b/homeassistant/components/tellduslive/cover.py index 246b22dc157..735219d7a8c 100644 --- a/homeassistant/components/tellduslive/cover.py +++ b/homeassistant/components/tellduslive/cover.py @@ -1,14 +1,10 @@ """Support for Tellstick covers using Tellstick Net.""" -import logging - from homeassistant.components import cover, tellduslive from homeassistant.components.cover import CoverEntity from homeassistant.helpers.dispatcher import async_dispatcher_connect from .entry import TelldusLiveEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up tellduslive sensors dynamically.""" diff --git a/homeassistant/components/tellduslive/sensor.py b/homeassistant/components/tellduslive/sensor.py index e322481813a..3ced0217ea9 100644 --- a/homeassistant/components/tellduslive/sensor.py +++ b/homeassistant/components/tellduslive/sensor.py @@ -1,6 +1,4 @@ """Support for Tellstick Net/Telstick Live sensors.""" -import logging - from homeassistant.components import sensor, tellduslive from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, @@ -19,8 +17,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from .entry import TelldusLiveEntity -_LOGGER = logging.getLogger(__name__) - SENSOR_TYPE_TEMPERATURE = "temp" SENSOR_TYPE_HUMIDITY = "humidity" SENSOR_TYPE_RAINRATE = "rrate" diff --git a/homeassistant/components/tellduslive/switch.py b/homeassistant/components/tellduslive/switch.py index 05a3c166213..9dd8ca93927 100644 --- a/homeassistant/components/tellduslive/switch.py +++ b/homeassistant/components/tellduslive/switch.py @@ -1,14 +1,10 @@ """Support for Tellstick switches using Tellstick Net.""" -import logging - from homeassistant.components import switch, tellduslive from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import ToggleEntity from .entry import TelldusLiveEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up tellduslive sensors dynamically.""" diff --git a/homeassistant/components/template/__init__.py b/homeassistant/components/template/__init__.py index a0f3a6a4a65..079569a9324 100644 --- a/homeassistant/components/template/__init__.py +++ b/homeassistant/components/template/__init__.py @@ -1,14 +1,9 @@ """The template component.""" - -import logging - from homeassistant.const import SERVICE_RELOAD from homeassistant.helpers.reload import async_reload_integration_platforms from .const import DOMAIN, EVENT_TEMPLATE_RELOADED, PLATFORMS -_LOGGER = logging.getLogger(__name__) - async def async_setup_reload_service(hass): """Create the reload service for the template domain.""" diff --git a/homeassistant/components/template/binary_sensor.py b/homeassistant/components/template/binary_sensor.py index 2e50448c037..0fd3205f20c 100644 --- a/homeassistant/components/template/binary_sensor.py +++ b/homeassistant/components/template/binary_sensor.py @@ -1,6 +1,4 @@ """Support for exposing a templated binary sensor.""" -import logging - import voluptuous as vol from homeassistant.components.binary_sensor import ( @@ -30,8 +28,6 @@ from homeassistant.helpers.template import result_as_boolean from .const import CONF_AVAILABILITY_TEMPLATE, DOMAIN, PLATFORMS from .template_entity import TemplateEntity -_LOGGER = logging.getLogger(__name__) - CONF_DELAY_ON = "delay_on" CONF_DELAY_OFF = "delay_off" CONF_ATTRIBUTE_TEMPLATES = "attribute_templates" diff --git a/homeassistant/components/template/lock.py b/homeassistant/components/template/lock.py index fa28436180e..2cd8bc00266 100644 --- a/homeassistant/components/template/lock.py +++ b/homeassistant/components/template/lock.py @@ -1,6 +1,4 @@ """Support for locks which integrates with other components.""" -import logging - import voluptuous as vol from homeassistant.components.lock import PLATFORM_SCHEMA, LockEntity @@ -21,8 +19,6 @@ from homeassistant.helpers.script import Script from .const import CONF_AVAILABILITY_TEMPLATE, DOMAIN, PLATFORMS from .template_entity import TemplateEntity -_LOGGER = logging.getLogger(__name__) - CONF_LOCK = "lock" CONF_UNLOCK = "unlock" diff --git a/homeassistant/components/template/sensor.py b/homeassistant/components/template/sensor.py index 754b3da27ac..aea14884812 100644 --- a/homeassistant/components/template/sensor.py +++ b/homeassistant/components/template/sensor.py @@ -1,5 +1,4 @@ """Allows the creation of a sensor that breaks out state_attributes.""" -import logging from typing import Optional import voluptuous as vol @@ -32,8 +31,6 @@ from .template_entity import TemplateEntity CONF_ATTRIBUTE_TEMPLATES = "attribute_templates" -_LOGGER = logging.getLogger(__name__) - SENSOR_SCHEMA = vol.All( cv.deprecated(ATTR_ENTITY_ID), vol.Schema( diff --git a/homeassistant/components/template/switch.py b/homeassistant/components/template/switch.py index d255d5b610c..511338b5aa1 100644 --- a/homeassistant/components/template/switch.py +++ b/homeassistant/components/template/switch.py @@ -1,5 +1,4 @@ """Support for switches which integrates with other components.""" -import logging import voluptuous as vol @@ -30,7 +29,6 @@ from homeassistant.helpers.script import Script from .const import CONF_AVAILABILITY_TEMPLATE, DOMAIN, PLATFORMS from .template_entity import TemplateEntity -_LOGGER = logging.getLogger(__name__) _VALID_STATES = [STATE_ON, STATE_OFF, "true", "false"] ON_ACTION = "turn_on" diff --git a/homeassistant/components/tesla/binary_sensor.py b/homeassistant/components/tesla/binary_sensor.py index 3c3777afc1f..77315ef1e3c 100644 --- a/homeassistant/components/tesla/binary_sensor.py +++ b/homeassistant/components/tesla/binary_sensor.py @@ -1,12 +1,9 @@ """Support for Tesla binary sensor.""" -import logging from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity from . import DOMAIN as TESLA_DOMAIN, TeslaDevice -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Tesla binary_sensors by config_entry.""" diff --git a/homeassistant/components/tesla/device_tracker.py b/homeassistant/components/tesla/device_tracker.py index 46265a96ae4..cac89d58d3a 100644 --- a/homeassistant/components/tesla/device_tracker.py +++ b/homeassistant/components/tesla/device_tracker.py @@ -1,5 +1,4 @@ """Support for tracking Tesla cars.""" -import logging from typing import Optional from homeassistant.components.device_tracker import SOURCE_TYPE_GPS @@ -7,8 +6,6 @@ from homeassistant.components.device_tracker.config_entry import TrackerEntity from . import DOMAIN as TESLA_DOMAIN, TeslaDevice -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Tesla binary_sensors by config_entry.""" diff --git a/homeassistant/components/tesla/sensor.py b/homeassistant/components/tesla/sensor.py index 50be1edc87d..3b66845c786 100644 --- a/homeassistant/components/tesla/sensor.py +++ b/homeassistant/components/tesla/sensor.py @@ -1,5 +1,4 @@ """Support for the Tesla sensors.""" -import logging from typing import Optional from homeassistant.components.sensor import DEVICE_CLASSES @@ -14,8 +13,6 @@ from homeassistant.util.distance import convert from . import DOMAIN as TESLA_DOMAIN, TeslaDevice -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Tesla binary_sensors by config_entry.""" diff --git a/homeassistant/components/thethingsnetwork/__init__.py b/homeassistant/components/thethingsnetwork/__init__.py index 65626a381ec..c31b4dc7bcd 100644 --- a/homeassistant/components/thethingsnetwork/__init__.py +++ b/homeassistant/components/thethingsnetwork/__init__.py @@ -1,12 +1,9 @@ """Support for The Things network.""" -import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_ACCESS_KEY = "access_key" CONF_APP_ID = "app_id" diff --git a/homeassistant/components/thinkingcleaner/sensor.py b/homeassistant/components/thinkingcleaner/sensor.py index ec8d6a5ef2b..966930f1eb1 100644 --- a/homeassistant/components/thinkingcleaner/sensor.py +++ b/homeassistant/components/thinkingcleaner/sensor.py @@ -1,6 +1,5 @@ """Support for ThinkingCleaner sensors.""" from datetime import timedelta -import logging from pythinkingcleaner import Discovery, ThinkingCleaner import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.const import CONF_HOST, PERCENTAGE import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10) MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100) diff --git a/homeassistant/components/thinkingcleaner/switch.py b/homeassistant/components/thinkingcleaner/switch.py index 6ef1a6f9556..6a1d20f9509 100644 --- a/homeassistant/components/thinkingcleaner/switch.py +++ b/homeassistant/components/thinkingcleaner/switch.py @@ -1,6 +1,5 @@ """Support for ThinkingCleaner switches.""" from datetime import timedelta -import logging import time from pythinkingcleaner import Discovery, ThinkingCleaner @@ -12,8 +11,6 @@ from homeassistant.const import CONF_HOST, STATE_OFF, STATE_ON import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import ToggleEntity -_LOGGER = logging.getLogger(__name__) - MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10) MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100) diff --git a/homeassistant/components/tibber/config_flow.py b/homeassistant/components/tibber/config_flow.py index 6f93a898e2f..8dce1e66a5a 100644 --- a/homeassistant/components/tibber/config_flow.py +++ b/homeassistant/components/tibber/config_flow.py @@ -1,6 +1,5 @@ """Adds config flow for Tibber integration.""" import asyncio -import logging import aiohttp import tibber @@ -12,8 +11,6 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import DOMAIN # pylint:disable=unused-import -_LOGGER = logging.getLogger(__name__) - DATA_SCHEMA = vol.Schema({vol.Required(CONF_ACCESS_TOKEN): str}) diff --git a/homeassistant/components/tof/sensor.py b/homeassistant/components/tof/sensor.py index d9ad178cab2..17b2d1010bf 100644 --- a/homeassistant/components/tof/sensor.py +++ b/homeassistant/components/tof/sensor.py @@ -2,7 +2,6 @@ import asyncio from functools import partial -import logging from VL53L1X2 import VL53L1X # pylint: disable=import-error import voluptuous as vol @@ -13,8 +12,6 @@ from homeassistant.const import CONF_NAME, LENGTH_MILLIMETERS import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - CONF_I2C_ADDRESS = "i2c_address" CONF_I2C_BUS = "i2c_bus" CONF_XSHUT = "xshut" diff --git a/homeassistant/components/toon/__init__.py b/homeassistant/components/toon/__init__.py index e2171f02290..d1753ad4d02 100644 --- a/homeassistant/components/toon/__init__.py +++ b/homeassistant/components/toon/__init__.py @@ -1,6 +1,5 @@ """Support for Toon van Eneco devices.""" import asyncio -import logging import voluptuous as vol @@ -35,8 +34,6 @@ ENTITY_COMPONENTS = { SWITCH_DOMAIN, } -_LOGGER = logging.getLogger(__name__) - # Validation of the user's configuration CONFIG_SCHEMA = vol.Schema( { diff --git a/homeassistant/components/toon/binary_sensor.py b/homeassistant/components/toon/binary_sensor.py index 135b25dddff..fe14435f2ab 100644 --- a/homeassistant/components/toon/binary_sensor.py +++ b/homeassistant/components/toon/binary_sensor.py @@ -1,5 +1,4 @@ """Support for Toon binary sensors.""" -import logging from typing import Optional from homeassistant.components.binary_sensor import BinarySensorEntity @@ -25,8 +24,6 @@ from .models import ( ToonEntity, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistantType, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/toon/climate.py b/homeassistant/components/toon/climate.py index 06f64262d2b..ba3ef8ee807 100644 --- a/homeassistant/components/toon/climate.py +++ b/homeassistant/components/toon/climate.py @@ -1,5 +1,4 @@ """Support for Toon thermostat.""" -import logging from typing import Any, Dict, List, Optional from toonapi import ( @@ -29,8 +28,6 @@ from .const import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP, DOMAIN from .helpers import toon_exception_handler from .models import ToonDisplayDeviceEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistantType, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/toon/models.py b/homeassistant/components/toon/models.py index 4047ac0d744..edcbed369a3 100644 --- a/homeassistant/components/toon/models.py +++ b/homeassistant/components/toon/models.py @@ -1,5 +1,4 @@ """DataUpdate Coordinator, and base Entity and Device models for Toon.""" -import logging from typing import Any, Dict, Optional from homeassistant.helpers.update_coordinator import CoordinatorEntity @@ -7,8 +6,6 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import ToonDataUpdateCoordinator -_LOGGER = logging.getLogger(__name__) - class ToonEntity(CoordinatorEntity): """Defines a base Toon entity.""" diff --git a/homeassistant/components/toon/oauth2.py b/homeassistant/components/toon/oauth2.py index feeb44b656a..2622e0a9027 100644 --- a/homeassistant/components/toon/oauth2.py +++ b/homeassistant/components/toon/oauth2.py @@ -1,5 +1,4 @@ """OAuth2 implementations for Toon.""" -import logging from typing import Any, Optional, cast from homeassistant.core import HomeAssistant @@ -8,8 +7,6 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession from . import config_flow -_LOGGER = logging.getLogger(__name__) - def register_oauth2_implementations( hass: HomeAssistant, client_id: str, client_secret: str diff --git a/homeassistant/components/toon/sensor.py b/homeassistant/components/toon/sensor.py index e686ff28211..52d3a68f2c1 100644 --- a/homeassistant/components/toon/sensor.py +++ b/homeassistant/components/toon/sensor.py @@ -1,5 +1,4 @@ """Support for Toon sensors.""" -import logging from typing import Optional from homeassistant.config_entries import ConfigEntry @@ -27,8 +26,6 @@ from .models import ( ToonWaterMeterDeviceEntity, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/toon/switch.py b/homeassistant/components/toon/switch.py index 22bdd6b100e..d529dd07075 100644 --- a/homeassistant/components/toon/switch.py +++ b/homeassistant/components/toon/switch.py @@ -1,5 +1,4 @@ """Support for Toon switches.""" -import logging from typing import Any from toonapi import ( @@ -27,8 +26,6 @@ from .coordinator import ToonDataUpdateCoordinator from .helpers import toon_exception_handler from .models import ToonDisplayDeviceEntity, ToonEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistantType, entry: ConfigEntry, async_add_entities diff --git a/homeassistant/components/torque/sensor.py b/homeassistant/components/torque/sensor.py index b4b44bdfb4f..4b52a565d87 100644 --- a/homeassistant/components/torque/sensor.py +++ b/homeassistant/components/torque/sensor.py @@ -1,5 +1,4 @@ """Support for the Torque OBD application.""" -import logging import re import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - API_PATH = "/api/torque" DEFAULT_NAME = "vehicle" diff --git a/homeassistant/components/totalconnect/config_flow.py b/homeassistant/components/totalconnect/config_flow.py index 3bc15a441d1..2608a3c812c 100644 --- a/homeassistant/components/totalconnect/config_flow.py +++ b/homeassistant/components/totalconnect/config_flow.py @@ -1,6 +1,4 @@ """Config flow for the Total Connect component.""" -import logging - from total_connect_client import TotalConnectClient import voluptuous as vol @@ -9,8 +7,6 @@ from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from .const import DOMAIN # pylint: disable=unused-import -_LOGGER = logging.getLogger(__name__) - class TotalConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Total Connect config flow.""" diff --git a/homeassistant/components/touchline/climate.py b/homeassistant/components/touchline/climate.py index 16709793ec1..3193b6f847c 100644 --- a/homeassistant/components/touchline/climate.py +++ b/homeassistant/components/touchline/climate.py @@ -1,6 +1,4 @@ """Platform for Roth Touchline floor heating controller.""" -import logging - from pytouchline import PyTouchline import voluptuous as vol @@ -13,8 +11,6 @@ from homeassistant.components.climate.const import ( from homeassistant.const import ATTR_TEMPERATURE, CONF_HOST, TEMP_CELSIUS import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - PRESET_MODES = { "Normal": {"mode": 0, "program": 0}, "Night": {"mode": 1, "program": 0}, diff --git a/homeassistant/components/traccar/__init__.py b/homeassistant/components/traccar/__init__.py index 5203ea5ec90..c19a9cdd27e 100644 --- a/homeassistant/components/traccar/__init__.py +++ b/homeassistant/components/traccar/__init__.py @@ -1,6 +1,4 @@ """Support for Traccar.""" -import logging - from aiohttp import web import voluptuous as vol @@ -23,8 +21,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - TRACKER_UPDATE = f"{DOMAIN}_tracker_update" diff --git a/homeassistant/components/tradfri/light.py b/homeassistant/components/tradfri/light.py index 939968852d9..bad4ce282b9 100644 --- a/homeassistant/components/tradfri/light.py +++ b/homeassistant/components/tradfri/light.py @@ -1,6 +1,4 @@ """Support for IKEA Tradfri lights.""" -import logging - from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, @@ -29,8 +27,6 @@ from .const import ( SUPPORTED_LIGHT_FEATURES, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Load Tradfri lights based on a config entry.""" diff --git a/homeassistant/components/transmission/sensor.py b/homeassistant/components/transmission/sensor.py index 69388de1145..ef1e68e2d0a 100644 --- a/homeassistant/components/transmission/sensor.py +++ b/homeassistant/components/transmission/sensor.py @@ -1,6 +1,4 @@ """Support for monitoring the Transmission BitTorrent client API.""" -import logging - from homeassistant.const import CONF_NAME, DATA_RATE_MEGABYTES_PER_SECOND, STATE_IDLE from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -14,8 +12,6 @@ from .const import ( SUPPORTED_ORDER_MODES, ) -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Transmission sensors.""" diff --git a/homeassistant/components/transport_nsw/sensor.py b/homeassistant/components/transport_nsw/sensor.py index e877e2d2e43..2aa27f8c4b3 100644 --- a/homeassistant/components/transport_nsw/sensor.py +++ b/homeassistant/components/transport_nsw/sensor.py @@ -1,6 +1,5 @@ """Support for Transport NSW (AU) to query next leave event.""" from datetime import timedelta -import logging from TransportNSW import TransportNSW import voluptuous as vol @@ -16,8 +15,6 @@ from homeassistant.const import ( import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -_LOGGER = logging.getLogger(__name__) - ATTR_STOP_ID = "stop_id" ATTR_ROUTE = "route" ATTR_DUE_IN = "due" diff --git a/homeassistant/components/twentemilieu/__init__.py b/homeassistant/components/twentemilieu/__init__.py index 15583b75499..06c2cb27f35 100644 --- a/homeassistant/components/twentemilieu/__init__.py +++ b/homeassistant/components/twentemilieu/__init__.py @@ -1,7 +1,6 @@ """Support for Twente Milieu.""" import asyncio from datetime import timedelta -import logging from typing import Optional from twentemilieu import TwenteMilieu @@ -24,8 +23,6 @@ from homeassistant.helpers.typing import ConfigType, HomeAssistantType SCAN_INTERVAL = timedelta(seconds=3600) -_LOGGER = logging.getLogger(__name__) - SERVICE_UPDATE = "update" SERVICE_SCHEMA = vol.Schema({vol.Optional(CONF_ID): cv.string}) diff --git a/homeassistant/components/twentemilieu/config_flow.py b/homeassistant/components/twentemilieu/config_flow.py index 071f035f4f9..76c9f33b3e9 100644 --- a/homeassistant/components/twentemilieu/config_flow.py +++ b/homeassistant/components/twentemilieu/config_flow.py @@ -1,6 +1,4 @@ """Config flow to configure the Twente Milieu integration.""" -import logging - from twentemilieu import ( TwenteMilieu, TwenteMilieuAddressError, @@ -19,8 +17,6 @@ from homeassistant.config_entries import ConfigFlow from homeassistant.const import CONF_ID from homeassistant.helpers.aiohttp_client import async_get_clientsession -_LOGGER = logging.getLogger(__name__) - @config_entries.HANDLERS.register(DOMAIN) class TwenteMilieuFlowHandler(ConfigFlow): diff --git a/homeassistant/components/twentemilieu/sensor.py b/homeassistant/components/twentemilieu/sensor.py index b1be9a071e4..92194e12172 100644 --- a/homeassistant/components/twentemilieu/sensor.py +++ b/homeassistant/components/twentemilieu/sensor.py @@ -1,5 +1,4 @@ """Support for Twente Milieu sensors.""" -import logging from typing import Any, Dict from twentemilieu import ( @@ -20,8 +19,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from homeassistant.helpers.typing import HomeAssistantType -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 diff --git a/homeassistant/components/unifi/device_tracker.py b/homeassistant/components/unifi/device_tracker.py index 4c5d3309c08..a3352631885 100644 --- a/homeassistant/components/unifi/device_tracker.py +++ b/homeassistant/components/unifi/device_tracker.py @@ -1,6 +1,5 @@ """Track devices using UniFi controllers.""" from datetime import timedelta -import logging from aiounifi.api import SOURCE_DATA, SOURCE_EVENT from aiounifi.events import ( @@ -29,8 +28,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__) - CLIENT_TRACKER = "client" DEVICE_TRACKER = "device" diff --git a/homeassistant/components/unifi/sensor.py b/homeassistant/components/unifi/sensor.py index ef38877533f..c0b8cea09c2 100644 --- a/homeassistant/components/unifi/sensor.py +++ b/homeassistant/components/unifi/sensor.py @@ -1,6 +1,4 @@ """Support for bandwidth sensors with UniFi clients.""" -import logging - from homeassistant.components.sensor import DEVICE_CLASS_TIMESTAMP, DOMAIN from homeassistant.const import DATA_MEGABYTES from homeassistant.core import callback @@ -10,8 +8,6 @@ import homeassistant.util.dt as dt_util from .const import DOMAIN as UNIFI_DOMAIN from .unifi_client import UniFiClient -LOGGER = logging.getLogger(__name__) - RX_SENSOR = "rx" TX_SENSOR = "tx" UPTIME_SENSOR = "uptime" diff --git a/homeassistant/components/unifi/switch.py b/homeassistant/components/unifi/switch.py index 013572c11e6..9bdb35baf4d 100644 --- a/homeassistant/components/unifi/switch.py +++ b/homeassistant/components/unifi/switch.py @@ -17,7 +17,7 @@ from homeassistant.helpers.restore_state import RestoreEntity from .const import DOMAIN as UNIFI_DOMAIN from .unifi_client import UniFiClient -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) BLOCK_SWITCH = "block" POE_SWITCH = "poe" @@ -225,7 +225,7 @@ class UniFiPOEClientSwitch(UniFiClient, SwitchEntity, RestoreEntity): try: return self.device.ports[self.client.sw_port] except (AttributeError, KeyError, TypeError): - LOGGER.warning( + _LOGGER.warning( "Entity %s reports faulty device %s or port %s", self.entity_id, self.client.sw_mac, diff --git a/homeassistant/components/unifi/unifi_client.py b/homeassistant/components/unifi/unifi_client.py index 224a057176c..17f5a473211 100644 --- a/homeassistant/components/unifi/unifi_client.py +++ b/homeassistant/components/unifi/unifi_client.py @@ -1,13 +1,8 @@ """Base class for UniFi clients.""" - -import logging - from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from .unifi_entity_base import UniFiBase -LOGGER = logging.getLogger(__name__) - class UniFiClient(UniFiBase): """Base class for UniFi clients.""" diff --git a/homeassistant/components/unifi/unifi_entity_base.py b/homeassistant/components/unifi/unifi_entity_base.py index 46a7123e4c9..42820cf69b0 100644 --- a/homeassistant/components/unifi/unifi_entity_base.py +++ b/homeassistant/components/unifi/unifi_entity_base.py @@ -6,7 +6,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_registry import async_entries_for_device -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) class UniFiBase(Entity): @@ -26,7 +26,9 @@ class UniFiBase(Entity): async def async_added_to_hass(self) -> None: """Entity created.""" - LOGGER.debug("New %s entity %s (%s)", self.TYPE, self.entity_id, self._item.mac) + _LOGGER.debug( + "New %s entity %s (%s)", self.TYPE, self.entity_id, self._item.mac + ) for signal, method in ( (self.controller.signal_reachable, self.async_update_callback), (self.controller.signal_options_update, self.options_updated), @@ -37,7 +39,7 @@ class UniFiBase(Entity): async def async_will_remove_from_hass(self) -> None: """Disconnect object when removed.""" - LOGGER.debug( + _LOGGER.debug( "Removing %s entity %s (%s)", self.TYPE, self.entity_id, self._item.mac ) self._item.remove_callback(self.async_update_callback) @@ -46,7 +48,7 @@ class UniFiBase(Entity): @callback def async_update_callback(self) -> None: """Update the entity's state.""" - LOGGER.debug( + _LOGGER.debug( "Updating %s entity %s (%s)", self.TYPE, self.entity_id, self._item.mac ) self.async_write_ha_state() diff --git a/homeassistant/components/universal/media_player.py b/homeassistant/components/universal/media_player.py index aedc27c2a29..8fff0e80dfb 100644 --- a/homeassistant/components/universal/media_player.py +++ b/homeassistant/components/universal/media_player.py @@ -1,6 +1,5 @@ """Combination of multiple media players for a universal controller.""" from copy import copy -import logging import voluptuous as vol @@ -75,8 +74,6 @@ from homeassistant.helpers.event import TrackTemplate, async_track_template_resu from homeassistant.helpers.reload import async_setup_reload_service from homeassistant.helpers.service import async_call_from_config -_LOGGER = logging.getLogger(__name__) - ATTR_ACTIVE_CHILD = "active_child" ATTR_DATA = "data" diff --git a/homeassistant/components/velbus/binary_sensor.py b/homeassistant/components/velbus/binary_sensor.py index 8c4cc5a4043..74263d87234 100644 --- a/homeassistant/components/velbus/binary_sensor.py +++ b/homeassistant/components/velbus/binary_sensor.py @@ -1,13 +1,9 @@ """Support for Velbus Binary Sensors.""" -import logging - from homeassistant.components.binary_sensor import BinarySensorEntity from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus binary sensor based on config_entry.""" diff --git a/homeassistant/components/velbus/sensor.py b/homeassistant/components/velbus/sensor.py index d8644b4569a..095108b4401 100644 --- a/homeassistant/components/velbus/sensor.py +++ b/homeassistant/components/velbus/sensor.py @@ -1,13 +1,9 @@ """Support for Velbus sensors.""" -import logging - from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_KILO_WATT_HOUR from . import VelbusEntity from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, entry, async_add_entities): """Set up Velbus sensor based on config_entry.""" diff --git a/homeassistant/components/vera/binary_sensor.py b/homeassistant/components/vera/binary_sensor.py index 2e66d38e249..a84764209b2 100644 --- a/homeassistant/components/vera/binary_sensor.py +++ b/homeassistant/components/vera/binary_sensor.py @@ -1,5 +1,4 @@ """Support for Vera binary sensors.""" -import logging from typing import Callable, List, Optional import pyvera as veraApi @@ -16,8 +15,6 @@ from homeassistant.helpers.entity import Entity from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/vera/climate.py b/homeassistant/components/vera/climate.py index 0946de4a379..70694af012f 100644 --- a/homeassistant/components/vera/climate.py +++ b/homeassistant/components/vera/climate.py @@ -1,5 +1,4 @@ """Support for Vera thermostats.""" -import logging from typing import Any, Callable, List, Optional import pyvera as veraApi @@ -28,8 +27,6 @@ from homeassistant.util import convert from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - FAN_OPERATION_LIST = [FAN_ON, FAN_AUTO] SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE diff --git a/homeassistant/components/vera/common.py b/homeassistant/components/vera/common.py index 66a2d6879dd..fce6475f930 100644 --- a/homeassistant/components/vera/common.py +++ b/homeassistant/components/vera/common.py @@ -1,5 +1,4 @@ """Common vera code.""" -import logging from typing import DefaultDict, List, NamedTuple, Set import pyvera as pv @@ -11,8 +10,6 @@ from homeassistant.helpers.event import call_later from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - class ControllerData(NamedTuple): """Controller data.""" diff --git a/homeassistant/components/vera/cover.py b/homeassistant/components/vera/cover.py index 49b15e91eb2..69e412bdade 100644 --- a/homeassistant/components/vera/cover.py +++ b/homeassistant/components/vera/cover.py @@ -1,5 +1,4 @@ """Support for Vera cover - curtains, rollershutters etc.""" -import logging from typing import Any, Callable, List import pyvera as veraApi @@ -17,8 +16,6 @@ from homeassistant.helpers.entity import Entity from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/vera/light.py b/homeassistant/components/vera/light.py index 47d2d039d2a..7daaf095a5c 100644 --- a/homeassistant/components/vera/light.py +++ b/homeassistant/components/vera/light.py @@ -1,5 +1,4 @@ """Support for Vera lights.""" -import logging from typing import Any, Callable, List, Optional, Tuple import pyvera as veraApi @@ -21,8 +20,6 @@ import homeassistant.util.color as color_util from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/vera/lock.py b/homeassistant/components/vera/lock.py index 46f8c6f189e..36a5f4cf2f3 100644 --- a/homeassistant/components/vera/lock.py +++ b/homeassistant/components/vera/lock.py @@ -1,5 +1,4 @@ """Support for Vera locks.""" -import logging from typing import Any, Callable, Dict, List, Optional import pyvera as veraApi @@ -17,8 +16,6 @@ from homeassistant.helpers.entity import Entity from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - ATTR_LAST_USER_NAME = "changed_by_name" ATTR_LOW_BATTERY = "low_battery" diff --git a/homeassistant/components/vera/scene.py b/homeassistant/components/vera/scene.py index 8bd4473e1c8..a031aadb66c 100644 --- a/homeassistant/components/vera/scene.py +++ b/homeassistant/components/vera/scene.py @@ -1,5 +1,4 @@ """Support for Vera scenes.""" -import logging from typing import Any, Callable, Dict, List, Optional import pyvera as veraApi @@ -13,8 +12,6 @@ from homeassistant.util import slugify from .common import ControllerData, get_controller_data from .const import VERA_ID_FORMAT -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/vera/sensor.py b/homeassistant/components/vera/sensor.py index 9c3dd097a78..e39b752bbf3 100644 --- a/homeassistant/components/vera/sensor.py +++ b/homeassistant/components/vera/sensor.py @@ -1,6 +1,5 @@ """Support for Vera sensors.""" from datetime import timedelta -import logging from typing import Callable, List, Optional, cast import pyvera as veraApi @@ -15,8 +14,6 @@ from homeassistant.util import convert from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - SCAN_INTERVAL = timedelta(seconds=5) diff --git a/homeassistant/components/vera/switch.py b/homeassistant/components/vera/switch.py index 9e8360bf673..d0cbeba669c 100644 --- a/homeassistant/components/vera/switch.py +++ b/homeassistant/components/vera/switch.py @@ -1,5 +1,4 @@ """Support for Vera switches.""" -import logging from typing import Any, Callable, List, Optional import pyvera as veraApi @@ -17,8 +16,6 @@ from homeassistant.util import convert from . import VeraDevice from .common import ControllerData, get_controller_data -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistant, diff --git a/homeassistant/components/verisure/binary_sensor.py b/homeassistant/components/verisure/binary_sensor.py index 206a4072ace..5a7f4386ece 100644 --- a/homeassistant/components/verisure/binary_sensor.py +++ b/homeassistant/components/verisure/binary_sensor.py @@ -1,6 +1,4 @@ """Support for Verisure binary sensors.""" -import logging - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_CONNECTIVITY, BinarySensorEntity, @@ -8,8 +6,6 @@ from homeassistant.components.binary_sensor import ( from . import CONF_DOOR_WINDOW, HUB as hub -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Verisure binary sensors.""" diff --git a/homeassistant/components/verisure/sensor.py b/homeassistant/components/verisure/sensor.py index ff1c31f7302..437e45ba72a 100644 --- a/homeassistant/components/verisure/sensor.py +++ b/homeassistant/components/verisure/sensor.py @@ -1,13 +1,9 @@ """Support for Verisure sensors.""" -import logging - from homeassistant.const import PERCENTAGE, TEMP_CELSIUS from homeassistant.helpers.entity import Entity from . import CONF_HYDROMETERS, CONF_MOUSE, CONF_THERMOMETERS, HUB as hub -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Verisure platform.""" diff --git a/homeassistant/components/verisure/switch.py b/homeassistant/components/verisure/switch.py index 8025b22f402..4615e0a2a49 100644 --- a/homeassistant/components/verisure/switch.py +++ b/homeassistant/components/verisure/switch.py @@ -1,13 +1,10 @@ """Support for Verisure Smartplugs.""" -import logging from time import monotonic from homeassistant.components.switch import SwitchEntity from . import CONF_SMARTPLUGS, HUB as hub -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Verisure switch platform.""" diff --git a/homeassistant/components/version/sensor.py b/homeassistant/components/version/sensor.py index dcfdc115376..c030383a4a6 100644 --- a/homeassistant/components/version/sensor.py +++ b/homeassistant/components/version/sensor.py @@ -1,6 +1,5 @@ """Sensor that can display the current Home Assistant versions.""" from datetime import timedelta -import logging from pyhaversion import ( DockerVersion, @@ -18,8 +17,6 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -_LOGGER = logging.getLogger(__name__) - ALL_IMAGES = [ "default", "intel-nuc", diff --git a/homeassistant/components/vesync/config_flow.py b/homeassistant/components/vesync/config_flow.py index 90db4db14b8..f930619d00b 100644 --- a/homeassistant/components/vesync/config_flow.py +++ b/homeassistant/components/vesync/config_flow.py @@ -1,6 +1,5 @@ """Config flow utilities.""" from collections import OrderedDict -import logging from pyvesync import VeSync import voluptuous as vol @@ -11,8 +10,6 @@ from homeassistant.core import callback from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - @callback def configured_instances(hass): diff --git a/homeassistant/components/vivotek/camera.py b/homeassistant/components/vivotek/camera.py index b1c7d2bb2a7..953d64f0ff6 100644 --- a/homeassistant/components/vivotek/camera.py +++ b/homeassistant/components/vivotek/camera.py @@ -1,7 +1,4 @@ """Support for Vivotek IP Cameras.""" - -import logging - from libpyvivotek import VivotekCamera import voluptuous as vol @@ -19,8 +16,6 @@ from homeassistant.const import ( ) from homeassistant.helpers import config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_FRAMERATE = "framerate" CONF_SECURITY_LEVEL = "security_level" CONF_STREAM_PATH = "stream_path" diff --git a/homeassistant/components/volumio/media_player.py b/homeassistant/components/volumio/media_player.py index 4edf44cc814..89fb17affc8 100644 --- a/homeassistant/components/volumio/media_player.py +++ b/homeassistant/components/volumio/media_player.py @@ -5,7 +5,6 @@ Volumio rest API: https://volumio.github.io/docs/API/REST_API.html """ from datetime import timedelta import json -import logging from homeassistant.components.media_player import MediaPlayerEntity from homeassistant.components.media_player.const import ( @@ -38,7 +37,6 @@ from .browse_media import browse_node, browse_top_level from .const import DATA_INFO, DATA_VOLUMIO, DOMAIN _CONFIGURING = {} -_LOGGER = logging.getLogger(__name__) SUPPORT_VOLUMIO = ( SUPPORT_PAUSE diff --git a/homeassistant/components/volvooncall/binary_sensor.py b/homeassistant/components/volvooncall/binary_sensor.py index 0dba6186ef9..f08b4509bd1 100644 --- a/homeassistant/components/volvooncall/binary_sensor.py +++ b/homeassistant/components/volvooncall/binary_sensor.py @@ -1,12 +1,8 @@ """Support for VOC.""" -import logging - from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity from . import DATA_KEY, VolvoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Volvo sensors.""" diff --git a/homeassistant/components/volvooncall/device_tracker.py b/homeassistant/components/volvooncall/device_tracker.py index 5e3909c9bed..eab42156c9a 100644 --- a/homeassistant/components/volvooncall/device_tracker.py +++ b/homeassistant/components/volvooncall/device_tracker.py @@ -1,14 +1,10 @@ """Support for tracking a Volvo.""" -import logging - from homeassistant.components.device_tracker import SOURCE_TYPE_GPS from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.util import slugify from . import DATA_KEY, SIGNAL_STATE_UPDATED -_LOGGER = logging.getLogger(__name__) - async def async_setup_scanner(hass, config, async_see, discovery_info=None): """Set up the Volvo tracker.""" diff --git a/homeassistant/components/volvooncall/lock.py b/homeassistant/components/volvooncall/lock.py index efb8423777b..6d9adcf1e1b 100644 --- a/homeassistant/components/volvooncall/lock.py +++ b/homeassistant/components/volvooncall/lock.py @@ -1,12 +1,8 @@ """Support for Volvo On Call locks.""" -import logging - from homeassistant.components.lock import LockEntity from . import DATA_KEY, VolvoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Volvo On Call lock.""" diff --git a/homeassistant/components/volvooncall/sensor.py b/homeassistant/components/volvooncall/sensor.py index 5132a7b8949..0915408860d 100644 --- a/homeassistant/components/volvooncall/sensor.py +++ b/homeassistant/components/volvooncall/sensor.py @@ -1,10 +1,6 @@ """Support for Volvo On Call sensors.""" -import logging - from . import DATA_KEY, VolvoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Volvo sensors.""" diff --git a/homeassistant/components/volvooncall/switch.py b/homeassistant/components/volvooncall/switch.py index da0f61c1d8f..535cfe75e50 100644 --- a/homeassistant/components/volvooncall/switch.py +++ b/homeassistant/components/volvooncall/switch.py @@ -1,12 +1,8 @@ """Support for Volvo heater.""" -import logging - from homeassistant.helpers.entity import ToggleEntity from . import DATA_KEY, VolvoEntity -_LOGGER = logging.getLogger(__name__) - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up a Volvo switch.""" diff --git a/homeassistant/components/watson_tts/tts.py b/homeassistant/components/watson_tts/tts.py index 67dfa32e673..27bfff9550b 100644 --- a/homeassistant/components/watson_tts/tts.py +++ b/homeassistant/components/watson_tts/tts.py @@ -1,6 +1,4 @@ """Support for IBM Watson TTS integration.""" -import logging - from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from ibm_watson import TextToSpeechV1 import voluptuous as vol @@ -8,8 +6,6 @@ import voluptuous as vol from homeassistant.components.tts import PLATFORM_SCHEMA, Provider import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) - CONF_URL = "watson_url" CONF_APIKEY = "watson_apikey" ATTR_CREDENTIALS = "credentials" diff --git a/homeassistant/components/webhook/trigger.py b/homeassistant/components/webhook/trigger.py index 0cdc7f103f5..81c4c2813cd 100644 --- a/homeassistant/components/webhook/trigger.py +++ b/homeassistant/components/webhook/trigger.py @@ -1,6 +1,5 @@ """Offer webhook triggered automation rules.""" from functools import partial -import logging from aiohttp import hdrs import voluptuous as vol @@ -13,8 +12,6 @@ import homeassistant.helpers.config_validation as cv DEPENDENCIES = ("webhook",) -_LOGGER = logging.getLogger(__name__) - TRIGGER_SCHEMA = vol.Schema( {vol.Required(CONF_PLATFORM): "webhook", vol.Required(CONF_WEBHOOK_ID): cv.string} ) diff --git a/homeassistant/components/websocket_api/commands.py b/homeassistant/components/websocket_api/commands.py index 2106e745351..80ea945834b 100644 --- a/homeassistant/components/websocket_api/commands.py +++ b/homeassistant/components/websocket_api/commands.py @@ -1,6 +1,5 @@ """Commands part of Websocket API.""" import asyncio -import logging import voluptuous as vol @@ -22,8 +21,6 @@ from homeassistant.loader import IntegrationNotFound, async_get_integration from . import const, decorators, messages -_LOGGER = logging.getLogger(__name__) - # mypy: allow-untyped-calls, allow-untyped-defs diff --git a/homeassistant/components/websocket_api/decorators.py b/homeassistant/components/websocket_api/decorators.py index d4a4cff1a8f..283734f7578 100644 --- a/homeassistant/components/websocket_api/decorators.py +++ b/homeassistant/components/websocket_api/decorators.py @@ -1,7 +1,6 @@ """Decorators for the Websocket API.""" import asyncio from functools import wraps -import logging from typing import Awaitable, Callable from homeassistant.core import HomeAssistant, callback @@ -12,8 +11,6 @@ from .connection import ActiveConnection # mypy: allow-untyped-calls, allow-untyped-defs -_LOGGER = logging.getLogger(__name__) - async def _handle_async_response(func, hass, connection, msg): """Create a response and handle exception.""" diff --git a/homeassistant/components/wilight/config_flow.py b/homeassistant/components/wilight/config_flow.py index 724bbb6547d..6bc81e363aa 100644 --- a/homeassistant/components/wilight/config_flow.py +++ b/homeassistant/components/wilight/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure WiLight.""" -import logging from urllib.parse import urlparse import pywilight @@ -18,8 +17,6 @@ WILIGHT_MANUFACTURER = "All Automacao Ltda" # List the components supported by this integration. ALLOWED_WILIGHT_COMPONENTS = ["light"] -_LOGGER = logging.getLogger(__name__) - class WiLightFlowHandler(ConfigFlow, domain=DOMAIN): """Handle a WiLight config flow.""" diff --git a/homeassistant/components/wink/alarm_control_panel.py b/homeassistant/components/wink/alarm_control_panel.py index 89dc6a46815..5c45cc7b03d 100644 --- a/homeassistant/components/wink/alarm_control_panel.py +++ b/homeassistant/components/wink/alarm_control_panel.py @@ -1,6 +1,4 @@ """Support Wink alarm control panels.""" -import logging - import pywink import homeassistant.components.alarm_control_panel as alarm @@ -16,8 +14,6 @@ from homeassistant.const import ( from . import DOMAIN, WinkDevice -_LOGGER = logging.getLogger(__name__) - STATE_ALARM_PRIVACY = "Private" diff --git a/homeassistant/components/wink/fan.py b/homeassistant/components/wink/fan.py index d1d4e30ada3..535e7094fcd 100644 --- a/homeassistant/components/wink/fan.py +++ b/homeassistant/components/wink/fan.py @@ -1,6 +1,4 @@ """Support for Wink fans.""" -import logging - import pywink from homeassistant.components.fan import ( @@ -14,8 +12,6 @@ from homeassistant.components.fan import ( from . import DOMAIN, WinkDevice -_LOGGER = logging.getLogger(__name__) - SPEED_AUTO = "auto" SPEED_LOWEST = "lowest" SUPPORTED_FEATURES = SUPPORT_DIRECTION + SUPPORT_SET_SPEED diff --git a/homeassistant/components/wink/lock.py b/homeassistant/components/wink/lock.py index 221d6d8165e..f82b74e7712 100644 --- a/homeassistant/components/wink/lock.py +++ b/homeassistant/components/wink/lock.py @@ -1,6 +1,4 @@ """Support for Wink locks.""" -import logging - import pywink import voluptuous as vol @@ -16,8 +14,6 @@ import homeassistant.helpers.config_validation as cv from . import DOMAIN, WinkDevice -_LOGGER = logging.getLogger(__name__) - SERVICE_SET_VACATION_MODE = "set_lock_vacation_mode" SERVICE_SET_ALARM_MODE = "set_lock_alarm_mode" SERVICE_SET_ALARM_SENSITIVITY = "set_lock_alarm_sensitivity" diff --git a/homeassistant/components/wink/scene.py b/homeassistant/components/wink/scene.py index 753e2c24278..3f4724957f8 100644 --- a/homeassistant/components/wink/scene.py +++ b/homeassistant/components/wink/scene.py @@ -1,5 +1,4 @@ """Support for Wink scenes.""" -import logging from typing import Any import pywink @@ -8,8 +7,6 @@ from homeassistant.components.scene import Scene from . import DOMAIN, WinkDevice -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Wink platform.""" diff --git a/homeassistant/components/wink/switch.py b/homeassistant/components/wink/switch.py index cf2264e7eeb..2632036095a 100644 --- a/homeassistant/components/wink/switch.py +++ b/homeassistant/components/wink/switch.py @@ -1,14 +1,10 @@ """Support for Wink switches.""" -import logging - import pywink from homeassistant.helpers.entity import ToggleEntity from . import DOMAIN, WinkDevice -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Wink platform.""" diff --git a/homeassistant/components/wirelesstag/binary_sensor.py b/homeassistant/components/wirelesstag/binary_sensor.py index b92cdeb0bca..ef97867e829 100644 --- a/homeassistant/components/wirelesstag/binary_sensor.py +++ b/homeassistant/components/wirelesstag/binary_sensor.py @@ -1,6 +1,4 @@ """Binary sensor support for Wireless Sensor Tags.""" -import logging - import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity @@ -15,8 +13,6 @@ from . import ( WirelessTagBaseSensor, ) -_LOGGER = logging.getLogger(__name__) - # On means in range, Off means out of range SENSOR_PRESENCE = "presence" diff --git a/homeassistant/components/wirelesstag/switch.py b/homeassistant/components/wirelesstag/switch.py index 9027f92aec0..11a5308d8d9 100644 --- a/homeassistant/components/wirelesstag/switch.py +++ b/homeassistant/components/wirelesstag/switch.py @@ -1,6 +1,4 @@ """Switch implementation for Wireless Sensor Tags (wirelesstag.net).""" -import logging - import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -9,8 +7,6 @@ import homeassistant.helpers.config_validation as cv from . import DOMAIN as WIRELESSTAG_DOMAIN, WirelessTagBaseSensor -_LOGGER = logging.getLogger(__name__) - ARM_TEMPERATURE = "temperature" ARM_HUMIDITY = "humidity" ARM_MOTION = "motion" diff --git a/homeassistant/components/withings/config_flow.py b/homeassistant/components/withings/config_flow.py index e1efa3406f2..d04327808de 100644 --- a/homeassistant/components/withings/config_flow.py +++ b/homeassistant/components/withings/config_flow.py @@ -10,8 +10,6 @@ from homeassistant.components.withings import const from homeassistant.helpers import config_entry_oauth2_flow from homeassistant.util import slugify -_LOGGER = logging.getLogger(__name__) - class WithingsFlowHandler( config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=const.DOMAIN diff --git a/homeassistant/components/wled/config_flow.py b/homeassistant/components/wled/config_flow.py index a3113335fb5..4d0f6bf1606 100644 --- a/homeassistant/components/wled/config_flow.py +++ b/homeassistant/components/wled/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure the WLED integration.""" -import logging from typing import Any, Dict, Optional import voluptuous as vol @@ -16,8 +15,6 @@ from homeassistant.helpers.typing import ConfigType from .const import DOMAIN # pylint: disable=unused-import -_LOGGER = logging.getLogger(__name__) - class WLEDFlowHandler(ConfigFlow, domain=DOMAIN): """Handle a WLED config flow.""" diff --git a/homeassistant/components/wled/light.py b/homeassistant/components/wled/light.py index 1e57dd3c1d3..9c6d027b058 100644 --- a/homeassistant/components/wled/light.py +++ b/homeassistant/components/wled/light.py @@ -1,6 +1,5 @@ """Support for LED lights.""" from functools import partial -import logging from typing import Any, Callable, Dict, List, Optional, Tuple, Union import voluptuous as vol @@ -45,8 +44,6 @@ from .const import ( SERVICE_EFFECT, ) -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 diff --git a/homeassistant/components/wled/sensor.py b/homeassistant/components/wled/sensor.py index 06445d03ba9..89d76776a82 100644 --- a/homeassistant/components/wled/sensor.py +++ b/homeassistant/components/wled/sensor.py @@ -1,6 +1,5 @@ """Support for WLED sensors.""" from datetime import timedelta -import logging from typing import Any, Callable, Dict, List, Optional from homeassistant.components.sensor import DEVICE_CLASS_CURRENT @@ -19,8 +18,6 @@ from homeassistant.util.dt import utcnow from . import WLEDDataUpdateCoordinator, WLEDDeviceEntity from .const import ATTR_LED_COUNT, ATTR_MAX_POWER, CURRENT_MA, DOMAIN -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry( hass: HomeAssistantType, diff --git a/homeassistant/components/wled/switch.py b/homeassistant/components/wled/switch.py index 440819927b1..38ebd0e9b29 100644 --- a/homeassistant/components/wled/switch.py +++ b/homeassistant/components/wled/switch.py @@ -1,5 +1,4 @@ """Support for WLED switches.""" -import logging from typing import Any, Callable, Dict, List, Optional from homeassistant.components.switch import SwitchEntity @@ -16,8 +15,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 diff --git a/homeassistant/components/wolflink/sensor.py b/homeassistant/components/wolflink/sensor.py index 1cae006824b..201979d4dc3 100644 --- a/homeassistant/components/wolflink/sensor.py +++ b/homeassistant/components/wolflink/sensor.py @@ -1,6 +1,4 @@ """The Wolf SmartSet sensors.""" -import logging - from wolf_smartset.models import ( HoursParameter, ListItemParameter, @@ -22,8 +20,6 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import COORDINATOR, DEVICE_ID, DOMAIN, PARAMETERS, STATES -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up all entries for Wolf Platform.""" diff --git a/homeassistant/components/worldclock/sensor.py b/homeassistant/components/worldclock/sensor.py index 3a3853d9f68..e02dc3a0d5c 100644 --- a/homeassistant/components/worldclock/sensor.py +++ b/homeassistant/components/worldclock/sensor.py @@ -1,6 +1,4 @@ """Support for showing the time in a different time zone.""" -import logging - import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -11,8 +9,6 @@ import homeassistant.util.dt as dt_util CONF_TIME_FORMAT = "time_format" -_LOGGER = logging.getLogger(__name__) - DEFAULT_NAME = "Worldclock Sensor" ICON = "mdi:clock" DEFAULT_TIME_STR_FORMAT = "%H:%M" diff --git a/homeassistant/components/xbox/config_flow.py b/homeassistant/components/xbox/config_flow.py index 9c4ff6f7df2..1d1f0cd8465 100644 --- a/homeassistant/components/xbox/config_flow.py +++ b/homeassistant/components/xbox/config_flow.py @@ -6,8 +6,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/xbox/media_player.py b/homeassistant/components/xbox/media_player.py index 9856904e2bd..41aaa7eeb9c 100644 --- a/homeassistant/components/xbox/media_player.py +++ b/homeassistant/components/xbox/media_player.py @@ -1,5 +1,4 @@ """Xbox Media Player Support.""" -import logging import re from typing import List, Optional @@ -35,8 +34,6 @@ from . import ConsoleData, XboxUpdateCoordinator from .browse_media import build_item_response from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - SUPPORT_XBOX = ( SUPPORT_TURN_ON | SUPPORT_TURN_OFF diff --git a/homeassistant/components/xbox/media_source.py b/homeassistant/components/xbox/media_source.py index 14bc1af5489..5615e11ea7f 100644 --- a/homeassistant/components/xbox/media_source.py +++ b/homeassistant/components/xbox/media_source.py @@ -1,6 +1,5 @@ """Xbox Media Source Implementation.""" from dataclasses import dataclass -import logging from typing import List, Tuple # pylint: disable=no-name-in-module @@ -31,8 +30,6 @@ from homeassistant.util import dt as dt_util from .browse_media import _find_media_image from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - MIME_TYPE_MAP = { "gameclips": "video/mp4", "screenshots": "image/png", diff --git a/homeassistant/components/xiaomi_aqara/cover.py b/homeassistant/components/xiaomi_aqara/cover.py index fbe7ae334e6..0ef74da83ff 100644 --- a/homeassistant/components/xiaomi_aqara/cover.py +++ b/homeassistant/components/xiaomi_aqara/cover.py @@ -1,13 +1,9 @@ """Support for Xiaomi curtain.""" -import logging - from homeassistant.components.cover import ATTR_POSITION, CoverEntity from . import XiaomiDevice from .const import DOMAIN, GATEWAYS_KEY -_LOGGER = logging.getLogger(__name__) - ATTR_CURTAIN_LEVEL = "curtain_level" DATA_KEY_PROTO_V1 = "status" diff --git a/homeassistant/components/xiaomi_aqara/lock.py b/homeassistant/components/xiaomi_aqara/lock.py index db858729995..7c5334e0f5c 100644 --- a/homeassistant/components/xiaomi_aqara/lock.py +++ b/homeassistant/components/xiaomi_aqara/lock.py @@ -1,6 +1,4 @@ """Support for Xiaomi Aqara locks.""" -import logging - from homeassistant.components.lock import LockEntity from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED from homeassistant.core import callback @@ -9,8 +7,6 @@ from homeassistant.helpers.event import async_call_later from . import XiaomiDevice from .const import DOMAIN, GATEWAYS_KEY -_LOGGER = logging.getLogger(__name__) - FINGER_KEY = "fing_verified" PASSWORD_KEY = "psw_verified" CARD_KEY = "card_verified" diff --git a/homeassistant/components/xiaomi_miio/__init__.py b/homeassistant/components/xiaomi_miio/__init__.py index 6957862ab7a..7ff1ed999c4 100644 --- a/homeassistant/components/xiaomi_miio/__init__.py +++ b/homeassistant/components/xiaomi_miio/__init__.py @@ -1,6 +1,4 @@ """Support for Xiaomi Miio.""" -import logging - from homeassistant import config_entries, core from homeassistant.const import CONF_HOST, CONF_TOKEN from homeassistant.helpers import device_registry as dr @@ -9,8 +7,6 @@ from .config_flow import CONF_FLOW_TYPE, CONF_GATEWAY from .const import DOMAIN from .gateway import ConnectXiaomiGateway -_LOGGER = logging.getLogger(__name__) - GATEWAY_PLATFORMS = ["alarm_control_panel", "sensor", "light"] diff --git a/homeassistant/components/xs1/climate.py b/homeassistant/components/xs1/climate.py index 60b6ca3c7c9..238fe2b8342 100644 --- a/homeassistant/components/xs1/climate.py +++ b/homeassistant/components/xs1/climate.py @@ -1,6 +1,4 @@ """Support for XS1 climate devices.""" -import logging - from xs1_api_client.api_constants import ActuatorType from homeassistant.components.climate import ClimateEntity @@ -12,8 +10,6 @@ from homeassistant.const import ATTR_TEMPERATURE from . import ACTUATORS, DOMAIN as COMPONENT_DOMAIN, SENSORS, XS1DeviceEntity -_LOGGER = logging.getLogger(__name__) - MIN_TEMP = 8 MAX_TEMP = 25 diff --git a/homeassistant/components/xs1/sensor.py b/homeassistant/components/xs1/sensor.py index 5c963ecafa3..9e6afa40fa4 100644 --- a/homeassistant/components/xs1/sensor.py +++ b/homeassistant/components/xs1/sensor.py @@ -1,14 +1,10 @@ """Support for XS1 sensors.""" -import logging - from xs1_api_client.api_constants import ActuatorType from homeassistant.helpers.entity import Entity from . import ACTUATORS, DOMAIN as COMPONENT_DOMAIN, SENSORS, XS1DeviceEntity -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the XS1 sensor platform.""" diff --git a/homeassistant/components/xs1/switch.py b/homeassistant/components/xs1/switch.py index cbb05b9aa62..a69c8e965eb 100644 --- a/homeassistant/components/xs1/switch.py +++ b/homeassistant/components/xs1/switch.py @@ -1,5 +1,4 @@ """Support for XS1 switches.""" -import logging from xs1_api_client.api_constants import ActuatorType @@ -7,8 +6,6 @@ from homeassistant.helpers.entity import ToggleEntity from . import ACTUATORS, DOMAIN as COMPONENT_DOMAIN, XS1DeviceEntity -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the XS1 switch platform.""" diff --git a/homeassistant/components/zha/climate.py b/homeassistant/components/zha/climate.py index 7ffb727bacc..728d0f48217 100644 --- a/homeassistant/components/zha/climate.py +++ b/homeassistant/components/zha/climate.py @@ -7,7 +7,6 @@ at https://home-assistant.io/components/zha.climate/ from datetime import datetime, timedelta import enum import functools -import logging from random import randint from typing import List, Optional, Tuple @@ -145,8 +144,6 @@ SYSTEM_MODE_2_HVAC = { ZCL_TEMP = 100 -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Zigbee Home Automation sensor from config entry.""" diff --git a/homeassistant/components/zha/core/channels/__init__.py b/homeassistant/components/zha/core/channels/__init__.py index f0ef6f382c4..dca80e9fcb3 100644 --- a/homeassistant/components/zha/core/channels/__init__.py +++ b/homeassistant/components/zha/core/channels/__init__.py @@ -1,6 +1,5 @@ """Channels module for Zigbee Home Automation.""" import asyncio -import logging from typing import Any, Dict, List, Optional, Tuple, Union import zigpy.zcl.clusters.closures @@ -30,7 +29,6 @@ from .. import ( typing as zha_typing, ) -_LOGGER = logging.getLogger(__name__) ChannelsDict = Dict[str, zha_typing.ChannelType] diff --git a/homeassistant/components/zha/core/channels/closures.py b/homeassistant/components/zha/core/channels/closures.py index 5641deffb60..0760427d46b 100644 --- a/homeassistant/components/zha/core/channels/closures.py +++ b/homeassistant/components/zha/core/channels/closures.py @@ -1,6 +1,4 @@ """Closures channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.closures as closures from homeassistant.core import callback @@ -9,8 +7,6 @@ from .. import registries from ..const import REPORT_CONFIG_IMMEDIATE, SIGNAL_ATTR_UPDATED from .base import ClientChannel, ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(closures.DoorLock.cluster_id) class DoorLockChannel(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/general.py b/homeassistant/components/zha/core/channels/general.py index 4738047c8c6..2cb744ec063 100644 --- a/homeassistant/components/zha/core/channels/general.py +++ b/homeassistant/components/zha/core/channels/general.py @@ -1,6 +1,5 @@ """General channels module for Zigbee Home Automation.""" import asyncio -import logging from typing import Any, List, Optional import zigpy.exceptions @@ -23,8 +22,6 @@ from ..const import ( ) from .base import ClientChannel, ZigbeeChannel, parse_and_log_command -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(general.Alarms.cluster_id) class Alarms(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/homeautomation.py b/homeassistant/components/zha/core/channels/homeautomation.py index e18f4ae9c17..03812be0548 100644 --- a/homeassistant/components/zha/core/channels/homeautomation.py +++ b/homeassistant/components/zha/core/channels/homeautomation.py @@ -1,5 +1,4 @@ """Home automation channels module for Zigbee Home Automation.""" -import logging from typing import Optional import zigpy.zcl.clusters.homeautomation as homeautomation @@ -12,8 +11,6 @@ from ..const import ( ) from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register( homeautomation.ApplianceEventAlerts.cluster_id diff --git a/homeassistant/components/zha/core/channels/hvac.py b/homeassistant/components/zha/core/channels/hvac.py index 17fbb86fc63..1eedf51cd00 100644 --- a/homeassistant/components/zha/core/channels/hvac.py +++ b/homeassistant/components/zha/core/channels/hvac.py @@ -6,7 +6,6 @@ https://home-assistant.io/integrations/zha/ """ import asyncio from collections import namedtuple -import logging from typing import Any, Dict, List, Optional, Tuple, Union from zigpy.exceptions import ZigbeeException @@ -25,8 +24,6 @@ from ..const import ( from ..helpers import retryable_req from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - AttributeUpdateRecord = namedtuple("AttributeUpdateRecord", "attr_id, attr_name, value") REPORT_CONFIG_CLIMATE = (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 25) REPORT_CONFIG_CLIMATE_DEMAND = (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 5) diff --git a/homeassistant/components/zha/core/channels/lighting.py b/homeassistant/components/zha/core/channels/lighting.py index 2b80a1092bb..ac88ba1c2c0 100644 --- a/homeassistant/components/zha/core/channels/lighting.py +++ b/homeassistant/components/zha/core/channels/lighting.py @@ -1,14 +1,10 @@ """Lighting channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.lighting as lighting from .. import registries, typing as zha_typing from ..const import REPORT_CONFIG_DEFAULT from .base import ClientChannel, ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(lighting.Ballast.cluster_id) class Ballast(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/lightlink.py b/homeassistant/components/zha/core/channels/lightlink.py index 25f3ebf9686..9a357d76eb7 100644 --- a/homeassistant/components/zha/core/channels/lightlink.py +++ b/homeassistant/components/zha/core/channels/lightlink.py @@ -1,13 +1,9 @@ """Lightlink channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.lightlink as lightlink from .. import registries from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.CHANNEL_ONLY_CLUSTERS.register(lightlink.LightLink.cluster_id) @registries.ZIGBEE_CHANNEL_REGISTRY.register(lightlink.LightLink.cluster_id) diff --git a/homeassistant/components/zha/core/channels/manufacturerspecific.py b/homeassistant/components/zha/core/channels/manufacturerspecific.py index cc56c10d06a..8b840e76317 100644 --- a/homeassistant/components/zha/core/channels/manufacturerspecific.py +++ b/homeassistant/components/zha/core/channels/manufacturerspecific.py @@ -1,6 +1,4 @@ """Manufacturer specific channels module for Zigbee Home Automation.""" -import logging - from homeassistant.core import callback from .. import registries @@ -16,8 +14,6 @@ from ..const import ( ) from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(registries.SMARTTHINGS_HUMIDITY_CLUSTER) class SmartThingsHumidity(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/measurement.py b/homeassistant/components/zha/core/channels/measurement.py index f05177de600..949b7cbc138 100644 --- a/homeassistant/components/zha/core/channels/measurement.py +++ b/homeassistant/components/zha/core/channels/measurement.py @@ -1,6 +1,4 @@ """Measurement channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.measurement as measurement from .. import registries @@ -12,8 +10,6 @@ from ..const import ( ) from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(measurement.FlowMeasurement.cluster_id) class FlowMeasurement(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/protocol.py b/homeassistant/components/zha/core/channels/protocol.py index 083e0f55841..4162809da7a 100644 --- a/homeassistant/components/zha/core/channels/protocol.py +++ b/homeassistant/components/zha/core/channels/protocol.py @@ -1,13 +1,9 @@ """Protocol channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.protocol as protocol from .. import registries from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(protocol.AnalogInputExtended.cluster_id) class AnalogInputExtended(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/security.py b/homeassistant/components/zha/core/channels/security.py index b2b6f74c0de..126dc761572 100644 --- a/homeassistant/components/zha/core/channels/security.py +++ b/homeassistant/components/zha/core/channels/security.py @@ -5,7 +5,6 @@ For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/zha/ """ import asyncio -import logging from zigpy.exceptions import ZigbeeException import zigpy.zcl.clusters.security as security @@ -23,8 +22,6 @@ from ..const import ( ) from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(security.IasAce.cluster_id) class IasAce(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/channels/smartenergy.py b/homeassistant/components/zha/core/channels/smartenergy.py index a4bd2bf2d40..d30f891dee1 100644 --- a/homeassistant/components/zha/core/channels/smartenergy.py +++ b/homeassistant/components/zha/core/channels/smartenergy.py @@ -1,6 +1,4 @@ """Smart energy channels module for Zigbee Home Automation.""" -import logging - import zigpy.zcl.clusters.smartenergy as smartenergy from homeassistant.const import ( @@ -16,8 +14,6 @@ from .. import registries, typing as zha_typing from ..const import REPORT_CONFIG_DEFAULT from .base import ZigbeeChannel -_LOGGER = logging.getLogger(__name__) - @registries.ZIGBEE_CHANNEL_REGISTRY.register(smartenergy.Calendar.cluster_id) class Calendar(ZigbeeChannel): diff --git a/homeassistant/components/zha/core/helpers.py b/homeassistant/components/zha/core/helpers.py index 0e967a7a123..9b62cef4ace 100644 --- a/homeassistant/components/zha/core/helpers.py +++ b/homeassistant/components/zha/core/helpers.py @@ -25,8 +25,6 @@ from homeassistant.core import State, callback from .const import CLUSTER_TYPE_IN, CLUSTER_TYPE_OUT, DATA_ZHA, DATA_ZHA_GATEWAY from .registries import BINDABLE_CLUSTERS -_LOGGER = logging.getLogger(__name__) - ClusterPair = collections.namedtuple("ClusterPair", "source_cluster target_cluster") diff --git a/homeassistant/components/zha/core/store.py b/homeassistant/components/zha/core/store.py index ab560820f19..051fcaa2925 100644 --- a/homeassistant/components/zha/core/store.py +++ b/homeassistant/components/zha/core/store.py @@ -2,7 +2,6 @@ # pylint: disable=unused-import from collections import OrderedDict import datetime -import logging import time from typing import MutableMapping, Optional, cast @@ -14,8 +13,6 @@ from homeassistant.loader import bind_hass from .typing import ZhaDeviceType -_LOGGER = logging.getLogger(__name__) - DATA_REGISTRY = "zha_storage" STORAGE_KEY = "zha.storage" diff --git a/homeassistant/components/zha/device_tracker.py b/homeassistant/components/zha/device_tracker.py index 824435e6337..53191789eba 100644 --- a/homeassistant/components/zha/device_tracker.py +++ b/homeassistant/components/zha/device_tracker.py @@ -1,6 +1,5 @@ """Support for the ZHA platform.""" import functools -import logging import time from homeassistant.components.device_tracker import DOMAIN, SOURCE_TYPE_ROUTER @@ -21,7 +20,6 @@ from .entity import ZhaEntity from .sensor import Battery STRICT_MATCH = functools.partial(ZHA_ENTITIES.strict_match, DOMAIN) -_LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass, config_entry, async_add_entities): diff --git a/homeassistant/components/zha/fan.py b/homeassistant/components/zha/fan.py index ac8edd10be5..9983967f764 100644 --- a/homeassistant/components/zha/fan.py +++ b/homeassistant/components/zha/fan.py @@ -1,6 +1,5 @@ """Fans on Zigbee Home Automation networks.""" import functools -import logging from typing import List from zigpy.exceptions import ZigbeeException @@ -30,8 +29,6 @@ from .core.const import ( from .core.registries import ZHA_ENTITIES from .entity import ZhaEntity, ZhaGroupEntity -_LOGGER = logging.getLogger(__name__) - # Additional speeds in zigbee's ZCL # Spec is unclear as to what this value means. On King Of Fans HBUniversal # receiver, this means Very High. diff --git a/homeassistant/components/zha/lock.py b/homeassistant/components/zha/lock.py index d951e7ada19..5cc7d7c56f6 100644 --- a/homeassistant/components/zha/lock.py +++ b/homeassistant/components/zha/lock.py @@ -1,6 +1,5 @@ """Locks on Zigbee Home Automation networks.""" import functools -import logging from zigpy.zcl.foundation import Status @@ -24,10 +23,7 @@ from .core.const import ( from .core.registries import ZHA_ENTITIES from .entity import ZhaEntity -_LOGGER = logging.getLogger(__name__) - -""" The first state is Zigbee 'Not fully locked' """ - +# The first state is Zigbee 'Not fully locked' STATE_LIST = [STATE_UNLOCKED, STATE_LOCKED, STATE_UNLOCKED] STRICT_MATCH = functools.partial(ZHA_ENTITIES.strict_match, DOMAIN) diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index fe305f3c25f..302637cc068 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -1,6 +1,5 @@ """Sensors on Zigbee Home Automation networks.""" import functools -import logging import numbers from homeassistant.components.sensor import ( @@ -45,7 +44,6 @@ from .core.registries import SMARTTHINGS_HUMIDITY_CLUSTER, ZHA_ENTITIES from .entity import ZhaEntity PARALLEL_UPDATES = 5 -_LOGGER = logging.getLogger(__name__) BATTERY_SIZES = { 0: "No battery", diff --git a/homeassistant/components/zha/switch.py b/homeassistant/components/zha/switch.py index 07c40c7175e..60db9ec0a08 100644 --- a/homeassistant/components/zha/switch.py +++ b/homeassistant/components/zha/switch.py @@ -1,6 +1,5 @@ """Switches on Zigbee Home Automation networks.""" import functools -import logging from typing import Any, List from zigpy.zcl.clusters.general import OnOff @@ -22,7 +21,6 @@ from .core.const import ( from .core.registries import ZHA_ENTITIES from .entity import ZhaEntity, ZhaGroupEntity -_LOGGER = logging.getLogger(__name__) STRICT_MATCH = functools.partial(ZHA_ENTITIES.strict_match, DOMAIN) GROUP_MATCH = functools.partial(ZHA_ENTITIES.group_match, DOMAIN) diff --git a/homeassistant/components/zodiac/sensor.py b/homeassistant/components/zodiac/sensor.py index 06bd52f6bf5..5113c5c6e18 100644 --- a/homeassistant/components/zodiac/sensor.py +++ b/homeassistant/components/zodiac/sensor.py @@ -1,6 +1,4 @@ """Support for tracking the zodiac sign.""" -import logging - from homeassistant.helpers.entity import Entity from homeassistant.util.dt import as_local, utcnow @@ -29,8 +27,6 @@ from .const import ( SIGN_VIRGO, ) -_LOGGER = logging.getLogger(__name__) - ZODIAC_BY_DATE = ( ( (21, 3), diff --git a/homeassistant/components/zwave/config_flow.py b/homeassistant/components/zwave/config_flow.py index 6357d9929b1..18c5d2f6f4e 100644 --- a/homeassistant/components/zwave/config_flow.py +++ b/homeassistant/components/zwave/config_flow.py @@ -1,7 +1,6 @@ """Config flow to configure Z-Wave.""" # pylint: disable=import-outside-toplevel from collections import OrderedDict -import logging import voluptuous as vol @@ -14,8 +13,6 @@ from .const import ( DOMAIN, ) -_LOGGER = logging.getLogger(__name__) - @config_entries.HANDLERS.register(DOMAIN) class ZwaveFlowHandler(config_entries.ConfigFlow): diff --git a/homeassistant/components/zwave/fan.py b/homeassistant/components/zwave/fan.py index a2dbc3a4eab..df6f5d8b8f5 100644 --- a/homeassistant/components/zwave/fan.py +++ b/homeassistant/components/zwave/fan.py @@ -1,5 +1,4 @@ """Support for Z-Wave fans.""" -import logging import math from homeassistant.components.fan import ( @@ -16,8 +15,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ZWaveDeviceEntity -_LOGGER = logging.getLogger(__name__) - SPEED_LIST = [SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH] SUPPORTED_FEATURES = SUPPORT_SET_SPEED diff --git a/homeassistant/components/zwave/node_entity.py b/homeassistant/components/zwave/node_entity.py index a9a4bf22b8b..064f21c69b4 100644 --- a/homeassistant/components/zwave/node_entity.py +++ b/homeassistant/components/zwave/node_entity.py @@ -1,7 +1,6 @@ """Entity class that represents Z-Wave node.""" # pylint: disable=import-outside-toplevel from itertools import count -import logging from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID, ATTR_WAKEUP from homeassistant.core import callback @@ -23,8 +22,6 @@ from .const import ( ) from .util import is_node_parsed, node_device_id_and_name, node_name -_LOGGER = logging.getLogger(__name__) - ATTR_QUERY_STAGE = "query_stage" ATTR_AWAKE = "is_awake" ATTR_READY = "is_ready" diff --git a/homeassistant/components/zwave/sensor.py b/homeassistant/components/zwave/sensor.py index b551e436352..aae38382f2e 100644 --- a/homeassistant/components/zwave/sensor.py +++ b/homeassistant/components/zwave/sensor.py @@ -1,6 +1,4 @@ """Support for Z-Wave sensors.""" -import logging - from homeassistant.components.sensor import DEVICE_CLASS_BATTERY, DOMAIN from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT from homeassistant.core import callback @@ -8,8 +6,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ZWaveDeviceEntity, const -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Z-Wave Sensor from Config Entry.""" diff --git a/homeassistant/components/zwave/switch.py b/homeassistant/components/zwave/switch.py index c5770bf7702..06606dac938 100644 --- a/homeassistant/components/zwave/switch.py +++ b/homeassistant/components/zwave/switch.py @@ -1,5 +1,4 @@ """Support for Z-Wave switches.""" -import logging import time from homeassistant.components.switch import DOMAIN, SwitchEntity @@ -8,8 +7,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ZWaveDeviceEntity, workaround -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Z-Wave Switch from Config Entry.""" diff --git a/homeassistant/components/zwave/websocket_api.py b/homeassistant/components/zwave/websocket_api.py index 24bf8d80a75..5e3a49df63c 100644 --- a/homeassistant/components/zwave/websocket_api.py +++ b/homeassistant/components/zwave/websocket_api.py @@ -1,7 +1,4 @@ """Web socket API for Z-Wave.""" - -import logging - import voluptuous as vol from homeassistant.components import websocket_api @@ -17,8 +14,6 @@ from .const import ( DATA_ZWAVE_CONFIG, ) -_LOGGER = logging.getLogger(__name__) - TYPE = "type" ID = "id" diff --git a/homeassistant/helpers/aiohttp_client.py b/homeassistant/helpers/aiohttp_client.py index d20e34cca36..e33492c21a8 100644 --- a/homeassistant/helpers/aiohttp_client.py +++ b/homeassistant/helpers/aiohttp_client.py @@ -1,6 +1,5 @@ """Helper for aiohttp webclient stuff.""" import asyncio -import logging from ssl import SSLContext import sys from typing import Any, Awaitable, Optional, Union, cast @@ -18,8 +17,6 @@ from homeassistant.helpers.typing import HomeAssistantType from homeassistant.loader import bind_hass from homeassistant.util import ssl as ssl_util -_LOGGER = logging.getLogger(__name__) - DATA_CONNECTOR = "aiohttp_connector" DATA_CONNECTOR_NOTVERIFY = "aiohttp_connector_notverify" DATA_CLIENTSESSION = "aiohttp_clientsession" diff --git a/homeassistant/helpers/area_registry.py b/homeassistant/helpers/area_registry.py index e97b613ab16..347e552a012 100644 --- a/homeassistant/helpers/area_registry.py +++ b/homeassistant/helpers/area_registry.py @@ -1,7 +1,6 @@ """Provide a way to connect devices to one physical location.""" from asyncio import Event from collections import OrderedDict -import logging from typing import Dict, Iterable, List, MutableMapping, Optional, cast import attr @@ -12,8 +11,6 @@ import homeassistant.util.uuid as uuid_util from .typing import HomeAssistantType -_LOGGER = logging.getLogger(__name__) - DATA_REGISTRY = "area_registry" EVENT_AREA_REGISTRY_UPDATED = "area_registry_updated" STORAGE_KEY = "core.area_registry" diff --git a/homeassistant/helpers/json.py b/homeassistant/helpers/json.py index 4acb9fd500a..3168310dc59 100644 --- a/homeassistant/helpers/json.py +++ b/homeassistant/helpers/json.py @@ -1,11 +1,8 @@ """Helpers to help with encoding Home Assistant objects in JSON.""" from datetime import datetime import json -import logging from typing import Any -_LOGGER = logging.getLogger(__name__) - class JSONEncoder(json.JSONEncoder): """JSONEncoder that supports Home Assistant objects.""" diff --git a/homeassistant/util/distance.py b/homeassistant/util/distance.py index 70fc9ad4eaa..3ae809b2a9f 100644 --- a/homeassistant/util/distance.py +++ b/homeassistant/util/distance.py @@ -1,6 +1,4 @@ """Distance util functions.""" - -import logging from numbers import Number from homeassistant.const import ( @@ -12,8 +10,6 @@ from homeassistant.const import ( UNIT_NOT_RECOGNIZED_TEMPLATE, ) -_LOGGER = logging.getLogger(__name__) - VALID_UNITS = [LENGTH_KILOMETERS, LENGTH_MILES, LENGTH_FEET, LENGTH_METERS] diff --git a/homeassistant/util/pressure.py b/homeassistant/util/pressure.py index 046b65122a9..22ad86a6896 100644 --- a/homeassistant/util/pressure.py +++ b/homeassistant/util/pressure.py @@ -1,6 +1,4 @@ """Pressure util functions.""" - -import logging from numbers import Number from homeassistant.const import ( @@ -13,8 +11,6 @@ from homeassistant.const import ( UNIT_NOT_RECOGNIZED_TEMPLATE, ) -_LOGGER = logging.getLogger(__name__) - VALID_UNITS = [PRESSURE_PA, PRESSURE_HPA, PRESSURE_MBAR, PRESSURE_INHG, PRESSURE_PSI] UNIT_CONVERSION = { diff --git a/homeassistant/util/timeout.py b/homeassistant/util/timeout.py index 1193c701712..8c3d38a3700 100644 --- a/homeassistant/util/timeout.py +++ b/homeassistant/util/timeout.py @@ -7,7 +7,6 @@ from __future__ import annotations import asyncio import enum -import logging from types import TracebackType from typing import Any, Dict, List, Optional, Type, Union @@ -15,8 +14,6 @@ from .async_ import run_callback_threadsafe ZONE_GLOBAL = "global" -_LOGGER = logging.getLogger(__name__) - class _State(str, enum.Enum): """States of a task.""" diff --git a/homeassistant/util/unit_system.py b/homeassistant/util/unit_system.py index bac66cd28bc..9e0d0c2c979 100644 --- a/homeassistant/util/unit_system.py +++ b/homeassistant/util/unit_system.py @@ -1,6 +1,4 @@ """Unit system helper class and methods.""" - -import logging from numbers import Number from typing import Optional @@ -33,8 +31,6 @@ from homeassistant.util import ( volume as volume_util, ) -_LOGGER = logging.getLogger(__name__) - LENGTH_UNITS = distance_util.VALID_UNITS MASS_UNITS = [MASS_POUNDS, MASS_OUNCES, MASS_KILOGRAMS, MASS_GRAMS] diff --git a/homeassistant/util/volume.py b/homeassistant/util/volume.py index 30185e4346c..5d94f848cd8 100644 --- a/homeassistant/util/volume.py +++ b/homeassistant/util/volume.py @@ -1,6 +1,4 @@ """Volume conversion util functions.""" - -import logging from numbers import Number from homeassistant.const import ( @@ -12,8 +10,6 @@ from homeassistant.const import ( VOLUME_MILLILITERS, ) -_LOGGER = logging.getLogger(__name__) - VALID_UNITS = [VOLUME_LITERS, VOLUME_MILLILITERS, VOLUME_GALLONS, VOLUME_FLUID_OUNCE] diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index 7a9208da7d1..6f94b88816c 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -2,7 +2,6 @@ from functools import partial from itertools import chain import json -import logging import re from typing import Dict @@ -15,8 +14,6 @@ from script.translations import upload from .model import Config, Integration -_LOGGER = logging.getLogger(__name__) - UNDEFINED = 0 REQUIRED = 1 REMOVED = 2 diff --git a/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py b/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py index 2343e1d79f8..8670c8a7b43 100644 --- a/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py +++ b/script/scaffold/templates/config_flow_oauth2/integration/config_flow.py @@ -6,8 +6,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/tests/components/bond/test_cover.py b/tests/components/bond/test_cover.py index a9083a900e6..dbb8ee0f3b7 100644 --- a/tests/components/bond/test_cover.py +++ b/tests/components/bond/test_cover.py @@ -1,6 +1,5 @@ """Tests for the Bond cover device.""" from datetime import timedelta -import logging from bond_api import Action, DeviceType @@ -24,8 +23,6 @@ from .common import ( from tests.common import async_fire_time_changed -_LOGGER = logging.getLogger(__name__) - def shades(name: str): """Create motorized shades with given name.""" diff --git a/tests/components/bond/test_light.py b/tests/components/bond/test_light.py index 17b8c87978f..70b585a76da 100644 --- a/tests/components/bond/test_light.py +++ b/tests/components/bond/test_light.py @@ -1,6 +1,5 @@ """Tests for the Bond light device.""" from datetime import timedelta -import logging from bond_api import Action, DeviceType @@ -29,8 +28,6 @@ from .common import ( from tests.common import async_fire_time_changed -_LOGGER = logging.getLogger(__name__) - def ceiling_fan(name: str): """Create a ceiling fan (that has built-in light) with given name.""" diff --git a/tests/components/bond/test_switch.py b/tests/components/bond/test_switch.py index 2755a491a86..f2568f5fb99 100644 --- a/tests/components/bond/test_switch.py +++ b/tests/components/bond/test_switch.py @@ -1,6 +1,5 @@ """Tests for the Bond switch device.""" from datetime import timedelta -import logging from bond_api import Action, DeviceType @@ -19,8 +18,6 @@ from .common import ( from tests.common import async_fire_time_changed -_LOGGER = logging.getLogger(__name__) - def generic_device(name: str): """Create a generic device with given name.""" diff --git a/tests/components/google_assistant/test_trait.py b/tests/components/google_assistant/test_trait.py index d415c4f2476..d1f5f9a1293 100644 --- a/tests/components/google_assistant/test_trait.py +++ b/tests/components/google_assistant/test_trait.py @@ -1,6 +1,5 @@ """Tests for the Google Assistant traits.""" from datetime import datetime, timedelta -import logging import pytest @@ -57,8 +56,6 @@ from . import BASIC_CONFIG, MockConfig from tests.async_mock import patch from tests.common import async_mock_service -_LOGGER = logging.getLogger(__name__) - REQ_ID = "ff36a3cc-ec34-11e6-b1a0-64510650abcf" BASIC_DATA = helpers.RequestData( diff --git a/tests/components/hue/test_light.py b/tests/components/hue/test_light.py index 630e74cb1af..2029c32c82f 100644 --- a/tests/components/hue/test_light.py +++ b/tests/components/hue/test_light.py @@ -1,6 +1,5 @@ """Philips Hue lights platform tests.""" import asyncio -import logging import aiohue @@ -11,8 +10,6 @@ from homeassistant.util import color from tests.async_mock import Mock -_LOGGER = logging.getLogger(__name__) - HUE_LIGHT_NS = "homeassistant.components.light.hue." GROUP_RESPONSE = { "1": { diff --git a/tests/components/hue/test_sensor_base.py b/tests/components/hue/test_sensor_base.py index e50ac71c03a..fcf3513bc7c 100644 --- a/tests/components/hue/test_sensor_base.py +++ b/tests/components/hue/test_sensor_base.py @@ -1,6 +1,5 @@ """Philips Hue sensors platform tests.""" import asyncio -import logging import aiohue @@ -10,8 +9,6 @@ from .conftest import create_mock_bridge, setup_bridge_for_sensors as setup_brid from tests.async_mock import Mock -_LOGGER = logging.getLogger(__name__) - PRESENCE_SENSOR_1_PRESENT = { "state": {"presence": True, "lastupdated": "2019-01-01T01:00:00"}, "swupdate": {"state": "noupdates", "lastinstall": "2019-01-01T00:00:00"}, diff --git a/tests/components/insteon/mock_devices.py b/tests/components/insteon/mock_devices.py index e57d06d210c..f2afd6083a3 100644 --- a/tests/components/insteon/mock_devices.py +++ b/tests/components/insteon/mock_devices.py @@ -1,6 +1,4 @@ """Mock devices object to test Insteon.""" -import logging - from pyinsteon.address import Address from pyinsteon.device_types import ( GeneralController_MiniRemote_4, @@ -10,8 +8,6 @@ from pyinsteon.device_types import ( from tests.async_mock import AsyncMock, MagicMock -_LOGGER = logging.getLogger(__name__) - class MockSwitchLinc(SwitchedLightingControl_SwitchLinc): """Mock SwitchLinc device.""" diff --git a/tests/components/insteon/test_init.py b/tests/components/insteon/test_init.py index eed1ee76e8c..73620df6776 100644 --- a/tests/components/insteon/test_init.py +++ b/tests/components/insteon/test_init.py @@ -1,6 +1,5 @@ """Test the init file for the Insteon component.""" import asyncio -import logging from pyinsteon.address import Address @@ -44,8 +43,6 @@ from .mock_devices import MockDevices from tests.async_mock import patch from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - async def mock_successful_connection(*args, **kwargs): """Return a successful connection.""" diff --git a/tests/components/logbook/test_init.py b/tests/components/logbook/test_init.py index 78772b0ba83..7c16faf2361 100644 --- a/tests/components/logbook/test_init.py +++ b/tests/components/logbook/test_init.py @@ -3,7 +3,6 @@ import collections from datetime import datetime, timedelta import json -import logging import unittest import pytest @@ -42,8 +41,6 @@ from tests.async_mock import Mock, patch from tests.common import get_test_home_assistant, init_recorder_component, mock_platform from tests.components.recorder.common import trigger_db_commit -_LOGGER = logging.getLogger(__name__) - class TestComponentLogbook(unittest.TestCase): """Test the History component.""" diff --git a/tests/components/mobile_app/test_entity.py b/tests/components/mobile_app/test_entity.py index 1ec97c8c4e2..ba121d766ac 100644 --- a/tests/components/mobile_app/test_entity.py +++ b/tests/components/mobile_app/test_entity.py @@ -1,12 +1,7 @@ """Entity tests for mobile_app.""" - -import logging - from homeassistant.const import PERCENTAGE, STATE_UNKNOWN from homeassistant.helpers import device_registry -_LOGGER = logging.getLogger(__name__) - async def test_sensor(hass, create_registrations, webhook_client): """Test that sensors can be registered and updated.""" diff --git a/tests/components/mobile_app/test_webhook.py b/tests/components/mobile_app/test_webhook.py index a75cc4fe92c..b56b56f239a 100644 --- a/tests/components/mobile_app/test_webhook.py +++ b/tests/components/mobile_app/test_webhook.py @@ -1,6 +1,4 @@ """Webhook tests for mobile_app.""" -import logging - import pytest from homeassistant.components.camera import SUPPORT_STREAM as CAMERA_SUPPORT_STREAM @@ -16,8 +14,6 @@ from .const import CALL_SERVICE, FIRE_EVENT, REGISTER_CLEARTEXT, RENDER_TEMPLATE from tests.async_mock import patch from tests.common import async_mock_service -_LOGGER = logging.getLogger(__name__) - def encrypt_payload(secret_key, payload): """Return a encrypted payload given a key and dictionary of data.""" diff --git a/tests/components/modbus/conftest.py b/tests/components/modbus/conftest.py index 36495acc9c5..226ce572b58 100644 --- a/tests/components/modbus/conftest.py +++ b/tests/components/modbus/conftest.py @@ -1,5 +1,4 @@ """The tests for the Modbus sensor component.""" -import logging from unittest import mock import pytest @@ -17,8 +16,6 @@ import homeassistant.util.dt as dt_util from tests.common import MockModule, async_fire_time_changed, mock_integration -_LOGGER = logging.getLogger(__name__) - @pytest.fixture() def mock_hub(hass): diff --git a/tests/components/modbus/test_modbus_binary_sensor.py b/tests/components/modbus/test_modbus_binary_sensor.py index 53021b57849..91374cde22d 100644 --- a/tests/components/modbus/test_modbus_binary_sensor.py +++ b/tests/components/modbus/test_modbus_binary_sensor.py @@ -1,6 +1,5 @@ """The tests for the Modbus sensor component.""" from datetime import timedelta -import logging import pytest @@ -16,8 +15,6 @@ from homeassistant.const import CONF_NAME, STATE_OFF, STATE_ON from .conftest import run_base_read_test, setup_base_test -_LOGGER = logging.getLogger(__name__) - @pytest.mark.parametrize( "cfg,regs,expected", diff --git a/tests/components/modbus/test_modbus_sensor.py b/tests/components/modbus/test_modbus_sensor.py index f523115bb87..68cdbffa462 100644 --- a/tests/components/modbus/test_modbus_sensor.py +++ b/tests/components/modbus/test_modbus_sensor.py @@ -1,6 +1,5 @@ """The tests for the Modbus sensor component.""" from datetime import timedelta -import logging import pytest @@ -26,8 +25,6 @@ from homeassistant.const import CONF_NAME from .conftest import run_base_read_test, setup_base_test -_LOGGER = logging.getLogger(__name__) - @pytest.mark.parametrize( "cfg,regs,expected", diff --git a/tests/components/modbus/test_modbus_switch.py b/tests/components/modbus/test_modbus_switch.py index 1f8ebe91a28..75255389bea 100644 --- a/tests/components/modbus/test_modbus_switch.py +++ b/tests/components/modbus/test_modbus_switch.py @@ -1,6 +1,5 @@ """The tests for the Modbus switch component.""" from datetime import timedelta -import logging import pytest @@ -10,8 +9,6 @@ from homeassistant.const import CONF_NAME, CONF_SLAVE, STATE_OFF, STATE_ON from .conftest import run_base_read_test, setup_base_test -_LOGGER = logging.getLogger(__name__) - @pytest.mark.parametrize( "regs,expected", diff --git a/tests/components/mqtt_json/test_device_tracker.py b/tests/components/mqtt_json/test_device_tracker.py index d0f798c18ae..89b37e28b52 100644 --- a/tests/components/mqtt_json/test_device_tracker.py +++ b/tests/components/mqtt_json/test_device_tracker.py @@ -15,8 +15,6 @@ from homeassistant.setup import async_setup_component from tests.async_mock import patch from tests.common import async_fire_mqtt_message -_LOGGER = logging.getLogger(__name__) - LOCATION_MESSAGE = { "longitude": 1.0, "gps_accuracy": 60, diff --git a/tests/components/qwikswitch/test_init.py b/tests/components/qwikswitch/test_init.py index 5a68a6e6e7b..7d92d40f987 100644 --- a/tests/components/qwikswitch/test_init.py +++ b/tests/components/qwikswitch/test_init.py @@ -1,6 +1,5 @@ """Test qwikswitch sensors.""" import asyncio -import logging from aiohttp.client_exceptions import ClientError import pytest @@ -12,8 +11,6 @@ from homeassistant.setup import async_setup_component from tests.async_mock import Mock from tests.test_util.aiohttp import AiohttpClientMockResponse, MockLongPollSideEffect -_LOGGER = logging.getLogger(__name__) - @pytest.fixture def qs_devices(): diff --git a/tests/components/remember_the_milk/test_init.py b/tests/components/remember_the_milk/test_init.py index a743f61057d..e03475c9131 100644 --- a/tests/components/remember_the_milk/test_init.py +++ b/tests/components/remember_the_milk/test_init.py @@ -1,15 +1,10 @@ """Tests for the Remember The Milk component.""" - -import logging - import homeassistant.components.remember_the_milk as rtm from .const import JSON_STRING, PROFILE, TOKEN from tests.async_mock import Mock, mock_open, patch -_LOGGER = logging.getLogger(__name__) - def test_create_new(hass): """Test creating a new config file.""" diff --git a/tests/components/rflink/test_cover.py b/tests/components/rflink/test_cover.py index 392008e838d..fd3f5b84314 100644 --- a/tests/components/rflink/test_cover.py +++ b/tests/components/rflink/test_cover.py @@ -4,9 +4,6 @@ Test setup of RFLink covers component/platform. State tracking and control of RFLink cover devices. """ - -import logging - from homeassistant.components.rflink import EVENT_BUTTON_PRESSED from homeassistant.const import ( ATTR_ENTITY_ID, @@ -37,8 +34,6 @@ CONFIG = { }, } -_LOGGER = logging.getLogger(__name__) - async def test_default_setup(hass, monkeypatch): """Test all basic functionality of the RFLink cover component.""" diff --git a/tests/components/sma/test_sensor.py b/tests/components/sma/test_sensor.py index f12af1f3849..8aa8c3e5b4c 100644 --- a/tests/components/sma/test_sensor.py +++ b/tests/components/sma/test_sensor.py @@ -1,13 +1,10 @@ """SMA sensor tests.""" -import logging - from homeassistant.components.sensor import DOMAIN from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, VOLT from homeassistant.setup import async_setup_component from tests.common import assert_setup_component -_LOGGER = logging.getLogger(__name__) BASE_CFG = { "platform": "sma", "host": "1.1.1.1", diff --git a/tests/components/stream/common.py b/tests/components/stream/common.py index 2359a771035..c99cdef7984 100644 --- a/tests/components/stream/common.py +++ b/tests/components/stream/common.py @@ -1,7 +1,6 @@ """Collection of test helpers.""" from fractions import Fraction import io -import logging import av import numpy as np @@ -9,8 +8,6 @@ import numpy as np from homeassistant.components.stream import Stream from homeassistant.components.stream.const import ATTR_STREAMS, DOMAIN -_LOGGER = logging.getLogger(__name__) - AUDIO_SAMPLE_RATE = 8000 diff --git a/tests/components/tag/test_init.py b/tests/components/tag/test_init.py index ecb927c1c5c..442d3263f0a 100644 --- a/tests/components/tag/test_init.py +++ b/tests/components/tag/test_init.py @@ -1,6 +1,4 @@ """Tests for the tag component.""" -import logging - import pytest from homeassistant.components.tag import DOMAIN, TAGS, async_scan_tag @@ -10,8 +8,6 @@ from homeassistant.util import dt as dt_util from tests.async_mock import patch -_LOGGER = logging.getLogger(__name__) - @pytest.fixture def storage_setup(hass, hass_storage): diff --git a/tests/components/template/test_alarm_control_panel.py b/tests/components/template/test_alarm_control_panel.py index 7860622e658..abb2e7b4765 100644 --- a/tests/components/template/test_alarm_control_panel.py +++ b/tests/components/template/test_alarm_control_panel.py @@ -1,6 +1,4 @@ """The tests for the Template alarm control panel platform.""" -import logging - from homeassistant import setup from homeassistant.const import ( STATE_ALARM_ARMED_AWAY, @@ -15,8 +13,6 @@ from homeassistant.const import ( from tests.common import async_mock_service from tests.components.alarm_control_panel import common -_LOGGER = logging.getLogger(__name__) - async def test_template_state_text(hass): """Test the state text of a template.""" diff --git a/tests/components/template/test_cover.py b/tests/components/template/test_cover.py index 7202d8a3a1b..08c789633fc 100644 --- a/tests/components/template/test_cover.py +++ b/tests/components/template/test_cover.py @@ -1,6 +1,4 @@ """The tests the cover command line platform.""" -import logging - import pytest from homeassistant import setup @@ -25,8 +23,6 @@ from homeassistant.const import ( from tests.common import assert_setup_component, async_mock_service -_LOGGER = logging.getLogger(__name__) - ENTITY_COVER = "cover.test_template_cover" diff --git a/tests/components/template/test_fan.py b/tests/components/template/test_fan.py index 20ab78f958d..8e7c519def9 100644 --- a/tests/components/template/test_fan.py +++ b/tests/components/template/test_fan.py @@ -1,6 +1,4 @@ """The tests for the Template fan platform.""" -import logging - import pytest import voluptuous as vol @@ -20,9 +18,6 @@ from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE from tests.common import assert_setup_component, async_mock_service from tests.components.fan import common -_LOGGER = logging.getLogger(__name__) - - _TEST_FAN = "fan.test_fan" # Represent for fan's state _STATE_INPUT_BOOLEAN = "input_boolean.state" diff --git a/tests/components/template/test_lock.py b/tests/components/template/test_lock.py index f054a67cbbc..a00ca3b7e91 100644 --- a/tests/components/template/test_lock.py +++ b/tests/components/template/test_lock.py @@ -1,6 +1,4 @@ """The tests for the Template lock platform.""" -import logging - import pytest from homeassistant import setup @@ -9,8 +7,6 @@ from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, STATE_UNAVA from tests.common import assert_setup_component, async_mock_service -_LOGGER = logging.getLogger(__name__) - @pytest.fixture def calls(hass): diff --git a/tests/components/template/test_vacuum.py b/tests/components/template/test_vacuum.py index 23b03262a78..e18f8ecc059 100644 --- a/tests/components/template/test_vacuum.py +++ b/tests/components/template/test_vacuum.py @@ -1,6 +1,4 @@ """The tests for the Template vacuum platform.""" -import logging - import pytest from homeassistant import setup @@ -17,8 +15,6 @@ from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE, STATE_UN from tests.common import assert_setup_component, async_mock_service from tests.components.vacuum import common -_LOGGER = logging.getLogger(__name__) - _TEST_VACUUM = "vacuum.test_vacuum" _STATE_INPUT_SELECT = "input_select.state" _SPOT_CLEANING_INPUT_BOOLEAN = "input_boolean.spot_cleaning" diff --git a/tests/components/utility_meter/test_init.py b/tests/components/utility_meter/test_init.py index f946ce352a5..c3a5d829a05 100644 --- a/tests/components/utility_meter/test_init.py +++ b/tests/components/utility_meter/test_init.py @@ -1,6 +1,5 @@ """The tests for the utility_meter component.""" from datetime import timedelta -import logging from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.components.utility_meter.const import ( @@ -21,8 +20,6 @@ import homeassistant.util.dt as dt_util from tests.async_mock import patch -_LOGGER = logging.getLogger(__name__) - async def test_services(hass): """Test energy sensor reset service.""" diff --git a/tests/components/utility_meter/test_sensor.py b/tests/components/utility_meter/test_sensor.py index 1fff168b748..6a2de3a1cd0 100644 --- a/tests/components/utility_meter/test_sensor.py +++ b/tests/components/utility_meter/test_sensor.py @@ -1,7 +1,6 @@ """The tests for the utility_meter sensor platform.""" from contextlib import contextmanager from datetime import timedelta -import logging from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.components.utility_meter.const import ( @@ -23,8 +22,6 @@ import homeassistant.util.dt as dt_util from tests.async_mock import patch from tests.common import async_fire_time_changed -_LOGGER = logging.getLogger(__name__) - @contextmanager def alter_time(retval): diff --git a/tests/components/vizio/const.py b/tests/components/vizio/const.py index 6ec746b2c54..963947f1bd3 100644 --- a/tests/components/vizio/const.py +++ b/tests/components/vizio/const.py @@ -1,6 +1,4 @@ """Constants for the Vizio integration tests.""" -import logging - from homeassistant.components.media_player import ( DEVICE_CLASS_SPEAKER, DEVICE_CLASS_TV, @@ -30,8 +28,6 @@ from homeassistant.const import ( ) from homeassistant.util import slugify -_LOGGER = logging.getLogger(__name__) - NAME = "Vizio" NAME2 = "Vizio2" HOST = "192.168.1.1:9000" diff --git a/tests/components/vizio/test_config_flow.py b/tests/components/vizio/test_config_flow.py index 2506a685e43..5cbc2fa5564 100644 --- a/tests/components/vizio/test_config_flow.py +++ b/tests/components/vizio/test_config_flow.py @@ -1,6 +1,4 @@ """Tests for Vizio config flow.""" -import logging - import pytest import voluptuous as vol @@ -55,8 +53,6 @@ from .const import ( from tests.common import MockConfigEntry -_LOGGER = logging.getLogger(__name__) - async def test_user_flow_minimum_fields( hass: HomeAssistantType, diff --git a/tests/components/vizio/test_media_player.py b/tests/components/vizio/test_media_player.py index c4620b07025..996d46e08a7 100644 --- a/tests/components/vizio/test_media_player.py +++ b/tests/components/vizio/test_media_player.py @@ -1,7 +1,6 @@ """Tests for Vizio config flow.""" from contextlib import asynccontextmanager from datetime import timedelta -import logging from typing import Any, Dict, List, Optional import pytest @@ -78,8 +77,6 @@ from .const import ( from tests.async_mock import call, patch from tests.common import MockConfigEntry, async_fire_time_changed -_LOGGER = logging.getLogger(__name__) - async def _add_config_entry_to_hass( hass: HomeAssistantType, config_entry: MockConfigEntry diff --git a/tests/components/zha/test_gateway.py b/tests/components/zha/test_gateway.py index 718c7cdba19..5d7f66bacd5 100644 --- a/tests/components/zha/test_gateway.py +++ b/tests/components/zha/test_gateway.py @@ -1,6 +1,5 @@ """Test ZHA Gateway.""" import asyncio -import logging import time from unittest.mock import patch @@ -17,7 +16,6 @@ from .common import async_enable_traffic, async_find_group_entity_id, get_zha_ga IEEE_GROUPABLE_DEVICE = "01:2d:6f:00:0a:90:69:e8" IEEE_GROUPABLE_DEVICE2 = "02:2d:6f:00:0a:90:69:e8" -_LOGGER = logging.getLogger(__name__) @pytest.fixture diff --git a/tests/helpers/test_collection.py b/tests/helpers/test_collection.py index f2224858bb5..11f1534defb 100644 --- a/tests/helpers/test_collection.py +++ b/tests/helpers/test_collection.py @@ -8,7 +8,7 @@ from homeassistant.helpers import collection, entity, entity_component, storage from tests.common import flush_store -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) def track_changes(coll: collection.ObservableCollection): @@ -85,7 +85,7 @@ def test_id_manager(): async def test_observable_collection(): """Test observerable collection.""" - coll = collection.ObservableCollection(LOGGER) + coll = collection.ObservableCollection(_LOGGER) assert coll.async_items() == [] coll.data["bla"] = 1 assert coll.async_items() == [1] @@ -99,7 +99,7 @@ async def test_observable_collection(): async def test_yaml_collection(): """Test a YAML collection.""" id_manager = collection.IDManager() - coll = collection.YamlCollection(LOGGER, id_manager) + coll = collection.YamlCollection(_LOGGER, id_manager) changes = track_changes(coll) await coll.async_load( [{"id": "mock-1", "name": "Mock 1"}, {"id": "mock-2", "name": "Mock 2"}] @@ -144,7 +144,7 @@ async def test_yaml_collection_skipping_duplicate_ids(): """Test YAML collection skipping duplicate IDs.""" id_manager = collection.IDManager() id_manager.add_collection({"existing": True}) - coll = collection.YamlCollection(LOGGER, id_manager) + coll = collection.YamlCollection(_LOGGER, id_manager) changes = track_changes(coll) await coll.async_load( [{"id": "mock-1", "name": "Mock 1"}, {"id": "existing", "name": "Mock 2"}] @@ -169,7 +169,7 @@ async def test_storage_collection(hass): } ) id_manager = collection.IDManager() - coll = MockStorageCollection(store, LOGGER, id_manager) + coll = MockStorageCollection(store, _LOGGER, id_manager) changes = track_changes(coll) await coll.async_load() @@ -222,8 +222,8 @@ async def test_storage_collection(hass): async def test_attach_entity_component_collection(hass): """Test attaching collection to entity component.""" - ent_comp = entity_component.EntityComponent(LOGGER, "test", hass) - coll = collection.ObservableCollection(LOGGER) + ent_comp = entity_component.EntityComponent(_LOGGER, "test", hass) + coll = collection.ObservableCollection(_LOGGER) collection.attach_entity_component_collection(ent_comp, coll, MockEntity) await coll.notify_change( @@ -252,7 +252,7 @@ async def test_attach_entity_component_collection(hass): async def test_storage_collection_websocket(hass, hass_ws_client): """Test exposing a storage collection via websockets.""" store = storage.Store(hass, 1, "test-data") - coll = MockStorageCollection(store, LOGGER) + coll = MockStorageCollection(store, _LOGGER) changes = track_changes(coll) collection.StorageCollectionWebsocket( coll, diff --git a/tests/helpers/test_update_coordinator.py b/tests/helpers/test_update_coordinator.py index ee3c4af6daf..72b9bff60f1 100644 --- a/tests/helpers/test_update_coordinator.py +++ b/tests/helpers/test_update_coordinator.py @@ -14,7 +14,7 @@ from homeassistant.util.dt import utcnow from tests.async_mock import AsyncMock, Mock, patch from tests.common import async_fire_time_changed -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) def get_crd(hass, update_interval): @@ -28,7 +28,7 @@ def get_crd(hass, update_interval): crd = update_coordinator.DataUpdateCoordinator[int]( hass, - LOGGER, + _LOGGER, name="test", update_method=refresh, update_interval=update_interval, diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 59e77dc1388..ed31724b58b 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -1,7 +1,6 @@ """Test the bootstrapping.""" # pylint: disable=protected-access import asyncio -import logging import os from unittest.mock import Mock @@ -25,8 +24,6 @@ from tests.common import ( ORIG_TIMEZONE = dt_util.DEFAULT_TIME_ZONE VERSION_PATH = os.path.join(get_test_config_dir(), config_util.VERSION_FILE) -_LOGGER = logging.getLogger(__name__) - @pytest.fixture(autouse=True) def apply_mock_storage(hass_storage): diff --git a/tests/test_setup.py b/tests/test_setup.py index 3d34d1e1383..ebcb1093779 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -1,7 +1,6 @@ """Test component/platform setup.""" # pylint: disable=protected-access import asyncio -import logging import os import threading @@ -34,8 +33,6 @@ from tests.common import ( ORIG_TIMEZONE = dt_util.DEFAULT_TIME_ZONE VERSION_PATH = os.path.join(get_test_config_dir(), config_util.VERSION_FILE) -_LOGGER = logging.getLogger(__name__) - @pytest.fixture(autouse=True) def mock_handlers(): -- GitLab