diff --git a/homeassistant/auth/providers/command_line.py b/homeassistant/auth/providers/command_line.py index e6300085299..961e1014c5e 100644 --- a/homeassistant/auth/providers/command_line.py +++ b/homeassistant/auth/providers/command_line.py @@ -75,7 +75,7 @@ class CommandLineAuthProvider(AuthProvider): if process.returncode != 0: _LOGGER.error( - "User %r failed to authenticate, command exited with code %d.", + "User %r failed to authenticate, command exited with code %d", username, process.returncode, ) diff --git a/homeassistant/components/__init__.py b/homeassistant/components/__init__.py index 90e0f32226c..31e937a0fe7 100644 --- a/homeassistant/components/__init__.py +++ b/homeassistant/components/__init__.py @@ -37,7 +37,7 @@ def is_on(hass, entity_id=None): continue if not hasattr(component, "is_on"): - _LOGGER.warning("Integration %s has no is_on method.", domain) + _LOGGER.warning("Integration %s has no is_on method", domain) continue if component.is_on(ent_id): diff --git a/homeassistant/components/adguard/__init__.py b/homeassistant/components/adguard/__init__.py index 95dbd0c3532..84e86bfcaba 100644 --- a/homeassistant/components/adguard/__init__.py +++ b/homeassistant/components/adguard/__init__.py @@ -183,7 +183,7 @@ class AdGuardHomeEntity(Entity): except AdGuardHomeError: if self._available: _LOGGER.debug( - "An error occurred while updating AdGuard Home sensor.", + "An error occurred while updating AdGuard Home sensor", exc_info=True, ) self._available = False diff --git a/homeassistant/components/adguard/switch.py b/homeassistant/components/adguard/switch.py index 78d2769ce5d..44aab11573d 100644 --- a/homeassistant/components/adguard/switch.py +++ b/homeassistant/components/adguard/switch.py @@ -73,7 +73,7 @@ class AdGuardHomeSwitch(AdGuardHomeDeviceEntity, SwitchEntity): try: await self._adguard_turn_off() except AdGuardHomeError: - _LOGGER.error("An error occurred while turning off AdGuard Home switch.") + _LOGGER.error("An error occurred while turning off AdGuard Home switch") self._available = False async def _adguard_turn_off(self) -> None: @@ -85,7 +85,7 @@ class AdGuardHomeSwitch(AdGuardHomeDeviceEntity, SwitchEntity): try: await self._adguard_turn_on() except AdGuardHomeError: - _LOGGER.error("An error occurred while turning on AdGuard Home switch.") + _LOGGER.error("An error occurred while turning on AdGuard Home switch") self._available = False async def _adguard_turn_on(self) -> None: diff --git a/homeassistant/components/alarmdecoder/__init__.py b/homeassistant/components/alarmdecoder/__init__.py index 178f31ee87a..0aa9fcc29ec 100644 --- a/homeassistant/components/alarmdecoder/__init__.py +++ b/homeassistant/components/alarmdecoder/__init__.py @@ -162,7 +162,7 @@ def setup(hass, config): if not restart: return restart = False - _LOGGER.warning("AlarmDecoder unexpectedly lost connection.") + _LOGGER.warning("AlarmDecoder unexpectedly lost connection") hass.add_job(open_connection) def handle_message(sender, message): diff --git a/homeassistant/components/alexa/auth.py b/homeassistant/components/alexa/auth.py index 090481876da..433b2929602 100644 --- a/homeassistant/components/alexa/auth.py +++ b/homeassistant/components/alexa/auth.py @@ -70,11 +70,11 @@ class Auth: await self.async_load_preferences() if self.is_token_valid(): - _LOGGER.debug("Token still valid, using it.") + _LOGGER.debug("Token still valid, using it") return self._prefs[STORAGE_ACCESS_TOKEN] if self._prefs[STORAGE_REFRESH_TOKEN] is None: - _LOGGER.debug("Token invalid and no refresh token available.") + _LOGGER.debug("Token invalid and no refresh token available") return None lwa_params = { @@ -84,7 +84,7 @@ class Auth: CONF_CLIENT_SECRET: self.client_secret, } - _LOGGER.debug("Calling LWA to refresh the access token.") + _LOGGER.debug("Calling LWA to refresh the access token") return await self._async_request_new_token(lwa_params) @callback @@ -113,14 +113,14 @@ class Auth: ) except (asyncio.TimeoutError, aiohttp.ClientError): - _LOGGER.error("Timeout calling LWA to get auth token.") + _LOGGER.error("Timeout calling LWA to get auth token") return None _LOGGER.debug("LWA response header: %s", response.headers) _LOGGER.debug("LWA response status: %s", response.status) if response.status != HTTP_OK: - _LOGGER.error("Error calling LWA to get auth token.") + _LOGGER.error("Error calling LWA to get auth token") return None response_json = await response.json() diff --git a/homeassistant/components/alexa/state_report.py b/homeassistant/components/alexa/state_report.py index b595bc98589..6c9b9ac5180 100644 --- a/homeassistant/components/alexa/state_report.py +++ b/homeassistant/components/alexa/state_report.py @@ -101,7 +101,7 @@ async def async_send_changereport_message( ) except (asyncio.TimeoutError, aiohttp.ClientError): - _LOGGER.error("Timeout sending report to Alexa.") + _LOGGER.error("Timeout sending report to Alexa") return response_text = await response.text() @@ -233,7 +233,7 @@ async def async_send_doorbell_event_message(hass, config, alexa_entity): ) except (asyncio.TimeoutError, aiohttp.ClientError): - _LOGGER.error("Timeout sending report to Alexa.") + _LOGGER.error("Timeout sending report to Alexa") return response_text = await response.text() diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index 1f024bf5882..181f70d725a 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -48,7 +48,7 @@ def setup(hass, config): try: apcups_data.update(no_throttle=True) except Exception: # pylint: disable=broad-except - _LOGGER.exception("Failure while testing APCUPSd status retrieval.") + _LOGGER.exception("Failure while testing APCUPSd status retrieval") return False return True diff --git a/homeassistant/components/aprs/device_tracker.py b/homeassistant/components/aprs/device_tracker.py index fb29a0ac8c7..1ce34c8a751 100644 --- a/homeassistant/components/aprs/device_tracker.py +++ b/homeassistant/components/aprs/device_tracker.py @@ -97,7 +97,7 @@ def setup_scanner(hass, config, see, discovery_info=None): hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, aprs_disconnect) if not aprs_listener.start_event.wait(timeout): - _LOGGER.error("Timeout waiting for APRS to connect.") + _LOGGER.error("Timeout waiting for APRS to connect") return if not aprs_listener.start_success: @@ -141,7 +141,7 @@ class AprsListenerThread(threading.Thread): try: _LOGGER.info( - "Opening connection to %s with callsign %s.", self.host, self.callsign + "Opening connection to %s with callsign %s", self.host, self.callsign ) self.ais.connect() self.start_complete( @@ -152,7 +152,7 @@ class AprsListenerThread(threading.Thread): self.start_complete(False, str(err)) except OSError: _LOGGER.info( - "Closing connection to %s with callsign %s.", self.host, self.callsign + "Closing connection to %s with callsign %s", self.host, self.callsign ) def stop(self): diff --git a/homeassistant/components/arlo/__init__.py b/homeassistant/components/arlo/__init__.py index 3cc0ec607a5..4338d3bab7e 100644 --- a/homeassistant/components/arlo/__init__.py +++ b/homeassistant/components/arlo/__init__.py @@ -59,7 +59,7 @@ def setup(hass, config): if arlo_base_station is not None: arlo_base_station.refresh_rate = scan_interval.total_seconds() elif not arlo.cameras: - _LOGGER.error("No Arlo camera or base station available.") + _LOGGER.error("No Arlo camera or base station available") return False hass.data[DATA_ARLO] = arlo diff --git a/homeassistant/components/asuswrt/__init__.py b/homeassistant/components/asuswrt/__init__.py index d9c87beea5d..1829d00a353 100644 --- a/homeassistant/components/asuswrt/__init__.py +++ b/homeassistant/components/asuswrt/__init__.py @@ -103,7 +103,7 @@ async def async_setup(hass, config, retry_delay=FIRST_RETRY_TIME): return True if not api.is_connected: - _LOGGER.error("Error connecting %s to %s.", DOMAIN, conf[CONF_HOST]) + _LOGGER.error("Error connecting %s to %s", DOMAIN, conf[CONF_HOST]) return False hass.data[DATA_ASUSWRT] = api diff --git a/homeassistant/components/atome/sensor.py b/homeassistant/components/atome/sensor.py index f9dd6b2dd61..1a8585653fe 100644 --- a/homeassistant/components/atome/sensor.py +++ b/homeassistant/components/atome/sensor.py @@ -143,7 +143,7 @@ class AtomeData: values = self.atome_client.get_consumption(DAILY_TYPE) self._day_usage = values["total"] / 1000 self._day_price = values["price"] - _LOGGER.debug("Updating Atome daily data. Got: %d.", self._day_usage) + _LOGGER.debug("Updating Atome daily data. Got: %d", self._day_usage) except KeyError as error: _LOGGER.error("Missing last value in values: %s: %s", values, error) @@ -165,7 +165,7 @@ class AtomeData: values = self.atome_client.get_consumption(WEEKLY_TYPE) self._week_usage = values["total"] / 1000 self._week_price = values["price"] - _LOGGER.debug("Updating Atome weekly data. Got: %d.", self._week_usage) + _LOGGER.debug("Updating Atome weekly data. Got: %d", self._week_usage) except KeyError as error: _LOGGER.error("Missing last value in values: %s: %s", values, error) @@ -187,7 +187,7 @@ class AtomeData: values = self.atome_client.get_consumption(MONTHLY_TYPE) self._month_usage = values["total"] / 1000 self._month_price = values["price"] - _LOGGER.debug("Updating Atome monthly data. Got: %d.", self._month_usage) + _LOGGER.debug("Updating Atome monthly data. Got: %d", self._month_usage) except KeyError as error: _LOGGER.error("Missing last value in values: %s: %s", values, error) @@ -209,7 +209,7 @@ class AtomeData: values = self.atome_client.get_consumption(YEARLY_TYPE) self._year_usage = values["total"] / 1000 self._year_price = values["price"] - _LOGGER.debug("Updating Atome yearly data. Got: %d.", self._year_usage) + _LOGGER.debug("Updating Atome yearly data. Got: %d", self._year_usage) except KeyError as error: _LOGGER.error("Missing last value in values: %s: %s", values, error) diff --git a/homeassistant/components/august/__init__.py b/homeassistant/components/august/__init__.py index 1b25564b8a6..9e0222dc81d 100644 --- a/homeassistant/components/august/__init__.py +++ b/homeassistant/components/august/__init__.py @@ -60,7 +60,7 @@ async def async_request_validation(hass, config_entry, august_gateway): # In the future this should start a new config flow # instead of using the legacy configurator # - _LOGGER.error("Access token is no longer valid.") + _LOGGER.error("Access token is no longer valid") configurator = hass.components.configurator entry_id = config_entry.entry_id @@ -351,7 +351,7 @@ class AugustData(AugustSubscriberMixin): doorbell_detail = self._device_detail_by_id.get(device_id) if doorbell_detail is None: _LOGGER.info( - "The doorbell %s could not be setup because the system could not fetch details about the doorbell.", + "The doorbell %s could not be setup because the system could not fetch details about the doorbell", doorbell.device_name, ) else: @@ -373,17 +373,17 @@ class AugustData(AugustSubscriberMixin): lock_detail = self._device_detail_by_id.get(device_id) if lock_detail is None: _LOGGER.info( - "The lock %s could not be setup because the system could not fetch details about the lock.", + "The lock %s could not be setup because the system could not fetch details about the lock", lock.device_name, ) elif lock_detail.bridge is None: _LOGGER.info( - "The lock %s could not be setup because it does not have a bridge (Connect).", + "The lock %s could not be setup because it does not have a bridge (Connect)", lock.device_name, ) elif not lock_detail.bridge.operative: _LOGGER.info( - "The lock %s could not be setup because the bridge (Connect) is not operative.", + "The lock %s could not be setup because the bridge (Connect) is not operative", lock.device_name, ) else: diff --git a/homeassistant/components/august/binary_sensor.py b/homeassistant/components/august/binary_sensor.py index 6602cfe8661..226cbf655f9 100644 --- a/homeassistant/components/august/binary_sensor.py +++ b/homeassistant/components/august/binary_sensor.py @@ -88,7 +88,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): detail = data.get_device_detail(door.device_id) if not detail.doorsense: _LOGGER.debug( - "Not adding sensor class door for lock %s because it does not have doorsense.", + "Not adding sensor class door for lock %s because it does not have doorsense", door.device_name, ) continue diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 433742da584..642c1d5678d 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -338,7 +338,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity): else: enable_automation = DEFAULT_INITIAL_STATE _LOGGER.debug( - "Automation %s not in state storage, state %s from default is used.", + "Automation %s not in state storage, state %s from default is used", self.entity_id, enable_automation, ) diff --git a/homeassistant/components/bmw_connected_drive/__init__.py b/homeassistant/components/bmw_connected_drive/__init__.py index b99ae97aa61..c72d1ce40fe 100644 --- a/homeassistant/components/bmw_connected_drive/__init__.py +++ b/homeassistant/components/bmw_connected_drive/__init__.py @@ -145,7 +145,7 @@ class BMWConnectedDriveAccount: except OSError as exception: _LOGGER.error( "Could not connect to the BMW Connected Drive portal. " - "The vehicle state could not be updated." + "The vehicle state could not be updated" ) _LOGGER.exception(exception) diff --git a/homeassistant/components/brunt/cover.py b/homeassistant/components/brunt/cover.py index 83c20ea1088..7f36874c40e 100644 --- a/homeassistant/components/brunt/cover.py +++ b/homeassistant/components/brunt/cover.py @@ -44,7 +44,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): try: things = bapi.getThings()["things"] if not things: - _LOGGER.error("No things present in account.") + _LOGGER.error("No things present in account") else: add_entities( [ diff --git a/homeassistant/components/buienradar/util.py b/homeassistant/components/buienradar/util.py index 4c69678d215..e64925bf19e 100644 --- a/homeassistant/components/buienradar/util.py +++ b/homeassistant/components/buienradar/util.py @@ -76,7 +76,7 @@ class BrData: async def schedule_update(self, minute=1): """Schedule an update after minute minutes.""" - _LOGGER.debug("Scheduling next update in %s minutes.", minute) + _LOGGER.debug("Scheduling next update in %s minutes", minute) nxt = dt_util.utcnow() + timedelta(minutes=minute) async_track_point_in_utc_time(self.hass, self.async_update, nxt) @@ -115,8 +115,7 @@ class BrData: self.load_error_count += 1 threshold_log( self.load_error_count, - "Unable to retrieve json data from Buienradar." - "(Msg: %s, status: %s,)", + "Unable to retrieve json data from Buienradar" "(Msg: %s, status: %s,)", content.get(MESSAGE), content.get(STATUS_CODE), ) @@ -136,7 +135,7 @@ class BrData: # unable to get the data threshold_log( self.rain_error_count, - "Unable to retrieve rain data from Buienradar." "(Msg: %s, status: %s)", + "Unable to retrieve rain data from Buienradar" "(Msg: %s, status: %s)", raincontent.get(MESSAGE), raincontent.get(STATUS_CODE), ) diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index fb33bef7d52..2e49b50651b 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -493,7 +493,7 @@ class CameraView(HomeAssistantView): raise web.HTTPUnauthorized() if not camera.is_on: - _LOGGER.debug("Camera is off.") + _LOGGER.debug("Camera is off") raise web.HTTPServiceUnavailable() return await self.handle(request, camera) @@ -549,7 +549,7 @@ async def websocket_camera_thumbnail(hass, connection, msg): Async friendly. """ - _LOGGER.warning("The websocket command 'camera_thumbnail' has been deprecated.") + _LOGGER.warning("The websocket command 'camera_thumbnail' has been deprecated") try: image = await async_get_image(hass, msg["entity_id"]) await connection.send_big_result( diff --git a/homeassistant/components/cast/discovery.py b/homeassistant/components/cast/discovery.py index 9266709a83a..341ba0c4c5e 100644 --- a/homeassistant/components/cast/discovery.py +++ b/homeassistant/components/cast/discovery.py @@ -104,7 +104,7 @@ def setup_internal_discovery(hass: HomeAssistant) -> None: ), ) - _LOGGER.debug("Starting internal pychromecast discovery.") + _LOGGER.debug("Starting internal pychromecast discovery") listener = pychromecast.CastListener( internal_add_update_callback, internal_remove_callback, @@ -114,7 +114,7 @@ def setup_internal_discovery(hass: HomeAssistant) -> None: def stop_discovery(event): """Stop discovery of new chromecasts.""" - _LOGGER.debug("Stopping internal pychromecast discovery.") + _LOGGER.debug("Stopping internal pychromecast discovery") pychromecast.discovery.stop_discovery(browser) hass.data[INTERNAL_DISCOVERY_RUNNING_KEY].release() diff --git a/homeassistant/components/cast/media_player.py b/homeassistant/components/cast/media_player.py index 3883c5ad725..43622124aa1 100644 --- a/homeassistant/components/cast/media_player.py +++ b/homeassistant/components/cast/media_player.py @@ -133,7 +133,7 @@ async def async_setup_platform( _LOGGER.warning( "Setting configuration for Cast via platform is deprecated. " "Configure via Cast integration instead." - "This option will become invalid in version 0.116." + "This option will become invalid in version 0.116" ) await _async_setup_platform(hass, config, async_add_entities, discovery_info) @@ -306,7 +306,7 @@ class CastDevice(MediaPlayerEntity): # Can't disconnect if not connected. return _LOGGER.debug( - "[%s %s] Disconnecting from chromecast socket.", + "[%s %s] Disconnecting from chromecast socket", self.entity_id, self._cast_info.friendly_name, ) @@ -479,7 +479,7 @@ class CastDevice(MediaPlayerEntity): self._chromecast.start_app(app_id) if app_data: _LOGGER.warning( - "Extra keys %s were ignored. Please use app_name to cast media.", + "Extra keys %s were ignored. Please use app_name to cast media", app_data.keys(), ) return diff --git a/homeassistant/components/coinmarketcap/sensor.py b/homeassistant/components/coinmarketcap/sensor.py index 2ae3de49817..f3fe240c0bc 100644 --- a/homeassistant/components/coinmarketcap/sensor.py +++ b/homeassistant/components/coinmarketcap/sensor.py @@ -64,7 +64,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): _LOGGER.warning( "Currency ID %s or display currency %s " "is not available. Using 1 (bitcoin) " - "and USD.", + "and USD", currency_id, display_currency, ) diff --git a/homeassistant/components/config/zwave.py b/homeassistant/components/config/zwave.py index b8331d8192b..edc2e9af42c 100644 --- a/homeassistant/components/config/zwave.py +++ b/homeassistant/components/config/zwave.py @@ -83,9 +83,9 @@ class ZWaveConfigWriteView(HomeAssistantView): network = hass.data.get(const.DATA_NETWORK) if network is None: return self.json_message("No Z-Wave network data found", HTTP_NOT_FOUND) - _LOGGER.info("Z-Wave configuration written to file.") + _LOGGER.info("Z-Wave configuration written to file") network.write_config() - return self.json_message("Z-Wave configuration saved to file.", HTTP_OK) + return self.json_message("Z-Wave configuration saved to file", HTTP_OK) class ZWaveNodeValueView(HomeAssistantView): diff --git a/homeassistant/components/decora_wifi/light.py b/homeassistant/components/decora_wifi/light.py index 6f716d3a5dc..93693b3d52a 100644 --- a/homeassistant/components/decora_wifi/light.py +++ b/homeassistant/components/decora_wifi/light.py @@ -66,7 +66,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): add_entities(DecoraWifiLight(sw) for sw in all_switches) except ValueError: - _LOGGER.error("Failed to communicate with myLeviton Service.") + _LOGGER.error("Failed to communicate with myLeviton Service") # Listen for the stop event and log out. def logout(event): @@ -75,7 +75,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): if session is not None: Person.logout(session) except ValueError: - _LOGGER.error("Failed to log out of myLeviton Service.") + _LOGGER.error("Failed to log out of myLeviton Service") hass.bus.listen(EVENT_HOMEASSISTANT_STOP, logout) @@ -127,7 +127,7 @@ class DecoraWifiLight(LightEntity): try: self._switch.update_attributes(attribs) except ValueError: - _LOGGER.error("Failed to turn on myLeviton switch.") + _LOGGER.error("Failed to turn on myLeviton switch") def turn_off(self, **kwargs): """Instruct the switch to turn off.""" @@ -135,11 +135,11 @@ class DecoraWifiLight(LightEntity): try: self._switch.update_attributes(attribs) except ValueError: - _LOGGER.error("Failed to turn off myLeviton switch.") + _LOGGER.error("Failed to turn off myLeviton switch") def update(self): """Fetch new state data for this switch.""" try: self._switch.refresh() except ValueError: - _LOGGER.error("Failed to update myLeviton switch data.") + _LOGGER.error("Failed to update myLeviton switch data") diff --git a/homeassistant/components/doorbird/__init__.py b/homeassistant/components/doorbird/__init__.py index 92ff25e7cf0..8f9ef2a3ed8 100644 --- a/homeassistant/components/doorbird/__init__.py +++ b/homeassistant/components/doorbird/__init__.py @@ -94,7 +94,7 @@ async def async_setup(hass: HomeAssistant, config: dict): doorstation = get_doorstation_by_token(hass, token) if doorstation is None: - _LOGGER.error("Device not found for provided token.") + _LOGGER.error("Device not found for provided token") return # Clear webhooks diff --git a/homeassistant/components/eight_sleep/__init__.py b/homeassistant/components/eight_sleep/__init__.py index 022878c8276..67c195da3e6 100644 --- a/homeassistant/components/eight_sleep/__init__.py +++ b/homeassistant/components/eight_sleep/__init__.py @@ -107,7 +107,7 @@ async def async_setup(hass, config): partner = conf.get(CONF_PARTNER) if hass.config.time_zone is None: - _LOGGER.error("Timezone is not set in Home Assistant.") + _LOGGER.error("Timezone is not set in Home Assistant") return False timezone = str(hass.config.time_zone) diff --git a/homeassistant/components/emulated_hue/upnp.py b/homeassistant/components/emulated_hue/upnp.py index 14e3cf11ca2..ecb78241771 100644 --- a/homeassistant/components/emulated_hue/upnp.py +++ b/homeassistant/components/emulated_hue/upnp.py @@ -168,6 +168,6 @@ USN: {unique_service_name} def clean_socket_close(sock): """Close a socket connection and logs its closure.""" - _LOGGER.info("UPNP responder shutting down.") + _LOGGER.info("UPNP responder shutting down") sock.close() diff --git a/homeassistant/components/envirophat/sensor.py b/homeassistant/components/envirophat/sensor.py index 1aa07c83027..4813fd47a92 100644 --- a/homeassistant/components/envirophat/sensor.py +++ b/homeassistant/components/envirophat/sensor.py @@ -53,7 +53,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): try: envirophat = importlib.import_module("envirophat") except OSError: - _LOGGER.error("No Enviro pHAT was found.") + _LOGGER.error("No Enviro pHAT was found") return False data = EnvirophatData(envirophat, config.get(CONF_USE_LEDS)) diff --git a/homeassistant/components/envisalink/__init__.py b/homeassistant/components/envisalink/__init__.py index 14113537de6..636cf0c19df 100644 --- a/homeassistant/components/envisalink/__init__.py +++ b/homeassistant/components/envisalink/__init__.py @@ -194,7 +194,7 @@ async def async_setup(hass, config): controller.callback_login_timeout = connection_fail_callback controller.callback_login_success = connection_success_callback - _LOGGER.info("Start envisalink.") + _LOGGER.info("Start envisalink") controller.start() result = await sync_connect diff --git a/homeassistant/components/everlights/light.py b/homeassistant/components/everlights/light.py index 95571a825b2..b1a210b8d15 100644 --- a/homeassistant/components/everlights/light.py +++ b/homeassistant/components/everlights/light.py @@ -160,9 +160,9 @@ class EverLightsLight(LightEntity): self._status = await self._api.get_status() except pyeverlights.ConnectionError: if self._available: - _LOGGER.warning("EverLights control box connection lost.") + _LOGGER.warning("EverLights control box connection lost") self._available = False else: if not self._available: - _LOGGER.warning("EverLights control box connection restored.") + _LOGGER.warning("EverLights control box connection restored") self._available = True diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index e4d2cf00e71..e436268db63 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -161,14 +161,14 @@ def _handle_exception(err) -> bool: if err.status == HTTP_SERVICE_UNAVAILABLE: _LOGGER.warning( "The vendor says their server is currently unavailable. " - "Check the vendor's service status page." + "Check the vendor's service status page" ) return False if err.status == HTTP_TOO_MANY_REQUESTS: _LOGGER.warning( "The vendor's API rate limit has been exceeded. " - "If this message persists, consider increasing the %s.", + "If this message persists, consider increasing the %s", CONF_SCAN_INTERVAL, ) return False @@ -221,7 +221,7 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool: except IndexError: _LOGGER.error( "Config error: '%s' = %s, but the valid range is 0-%s. " - "Unable to continue. Fix any configuration errors and restart HA.", + "Unable to continue. Fix any configuration errors and restart HA", CONF_LOCATION_IDX, loc_idx, len(client_v2.installation_info) - 1, diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index dcbffe2a568..fd2a9d39c00 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -134,7 +134,7 @@ class FibaroController: info = self._client.info.get() self.hub_serial = slugify(info.serialNumber) except AssertionError: - _LOGGER.error("Can't connect to Fibaro HC. Please check URL.") + _LOGGER.error("Can't connect to Fibaro HC. Please check URL") return False if login is None or login.status is False: _LOGGER.error( diff --git a/homeassistant/components/foobot/sensor.py b/homeassistant/components/foobot/sensor.py index e0322ccbab7..b685d42acf6 100644 --- a/homeassistant/components/foobot/sensor.py +++ b/homeassistant/components/foobot/sensor.py @@ -87,10 +87,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= FoobotClient.TooManyRequests, FoobotClient.InternalError, ): - _LOGGER.exception("Failed to connect to foobot servers.") + _LOGGER.exception("Failed to connect to foobot servers") raise PlatformNotReady except FoobotClient.ClientError: - _LOGGER.error("Failed to fetch data from foobot servers.") + _LOGGER.error("Failed to fetch data from foobot servers") return async_add_entities(dev, True) diff --git a/homeassistant/components/freebox/switch.py b/homeassistant/components/freebox/switch.py index 7f8934d9d65..00f87e21f47 100644 --- a/homeassistant/components/freebox/switch.py +++ b/homeassistant/components/freebox/switch.py @@ -59,7 +59,7 @@ class FreeboxWifiSwitch(SwitchEntity): await self._router.wifi.set_global_config(wifi_config) except InsufficientPermissionsError: _LOGGER.warning( - "Home Assistant does not have permissions to modify the Freebox settings. Please refer to documentation." + "Home Assistant does not have permissions to modify the Freebox settings. Please refer to documentation" ) async def async_turn_on(self, **kwargs): diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index aec574d8d40..40ebee220bc 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -349,7 +349,7 @@ def _async_setup_themes(hass, themes): hass.data[DATA_DEFAULT_THEME] = name update_theme_and_fire_event() else: - _LOGGER.warning("Theme %s is not defined.", name) + _LOGGER.warning("Theme %s is not defined", name) async def reload_themes(_): """Reload themes.""" diff --git a/homeassistant/components/garmin_connect/sensor.py b/homeassistant/components/garmin_connect/sensor.py index 78bf248c51b..48713789c6e 100644 --- a/homeassistant/components/garmin_connect/sensor.py +++ b/homeassistant/components/garmin_connect/sensor.py @@ -34,7 +34,7 @@ async def async_setup_entry( ) as err: _LOGGER.error("Error occurred during Garmin Connect Client update: %s", err) except Exception: # pylint: disable=broad-except - _LOGGER.exception("Unknown error occurred during Garmin Connect Client update.") + _LOGGER.exception("Unknown error occurred during Garmin Connect Client update") entities = [] for ( diff --git a/homeassistant/components/google/__init__.py b/homeassistant/components/google/__init__.py index 4f1accec4e0..78ea1616f99 100644 --- a/homeassistant/components/google/__init__.py +++ b/homeassistant/components/google/__init__.py @@ -222,7 +222,7 @@ def check_correct_scopes(token_file): """Check for the correct scopes in file.""" tokenfile = open(token_file).read() if "readonly" in tokenfile: - _LOGGER.warning("Please re-authenticate with Google.") + _LOGGER.warning("Please re-authenticate with Google") return False return True diff --git a/homeassistant/components/google_assistant/__init__.py b/homeassistant/components/google_assistant/__init__.py index 160ec024c81..b1182b436b5 100644 --- a/homeassistant/components/google_assistant/__init__.py +++ b/homeassistant/components/google_assistant/__init__.py @@ -106,7 +106,7 @@ async def async_setup(hass: HomeAssistant, yaml_config: Dict[str, Any]): if agent_user_id is None: _LOGGER.warning( - "No agent_user_id supplied for request_sync. Call as a user or pass in user id as agent_user_id." + "No agent_user_id supplied for request_sync. Call as a user or pass in user id as agent_user_id" ) return diff --git a/homeassistant/components/google_maps/device_tracker.py b/homeassistant/components/google_maps/device_tracker.py index 7b48c12cc93..b6bd6f71bf4 100644 --- a/homeassistant/components/google_maps/device_tracker.py +++ b/homeassistant/components/google_maps/device_tracker.py @@ -66,7 +66,7 @@ class GoogleMapsScanner: except InvalidCookies: _LOGGER.error( - "The cookie file provided does not provide a valid session. Please create another one and try again." + "The cookie file provided does not provide a valid session. Please create another one and try again" ) self.success_init = False diff --git a/homeassistant/components/harmony/remote.py b/homeassistant/components/harmony/remote.py index d5d8eb5773f..962c11a8cb3 100644 --- a/homeassistant/components/harmony/remote.py +++ b/homeassistant/components/harmony/remote.py @@ -258,7 +258,7 @@ class HarmonyRemote(remote.RemoteEntity): _LOGGER.debug("%s: Connecting", self._name) try: if not await self._client.connect(): - _LOGGER.warning("%s: Unable to connect to HUB.", self._name) + _LOGGER.warning("%s: Unable to connect to HUB", self._name) await self._client.close() return False except aioexc.TimeOut: @@ -283,14 +283,14 @@ class HarmonyRemote(remote.RemoteEntity): async def got_connected(self, _=None): """Notification that we're connected to the HUB.""" - _LOGGER.debug("%s: connected to the HUB.", self._name) + _LOGGER.debug("%s: connected to the HUB", self._name) if not self._available: # We were disconnected before. await self.new_config() async def got_disconnected(self, _=None): """Notification that we're disconnected from the HUB.""" - _LOGGER.debug("%s: disconnected from the HUB.", self._name) + _LOGGER.debug("%s: disconnected from the HUB", self._name) self._available = False # We're going to wait for 10 seconds before announcing we're # unavailable, this to allow a reconnection to happen. diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index d427b2be60d..f64461f70d3 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -196,7 +196,7 @@ async def async_setup(hass, config): for env in ("HASSIO", "HASSIO_TOKEN"): if os.environ.get(env): continue - _LOGGER.error("Missing %s environment variable.", env) + _LOGGER.error("Missing %s environment variable", env) return False host = os.environ["HASSIO"] diff --git a/homeassistant/components/hassio/auth.py b/homeassistant/components/hassio/auth.py index b95690641cd..066219d77e8 100644 --- a/homeassistant/components/hassio/auth.py +++ b/homeassistant/components/hassio/auth.py @@ -78,7 +78,7 @@ class HassIOBaseAuth(HomeAssistantView): if prv is not None: return prv - _LOGGER.error("Can't find Home Assistant auth.") + _LOGGER.error("Can't find Home Assistant auth") raise HTTPNotFound() diff --git a/homeassistant/components/hassio/handler.py b/homeassistant/components/hassio/handler.py index 9d3df7e8aec..cce17695e30 100644 --- a/homeassistant/components/hassio/handler.py +++ b/homeassistant/components/hassio/handler.py @@ -176,7 +176,7 @@ class HassIO: ) if request.status not in (HTTP_OK, HTTP_BAD_REQUEST): - _LOGGER.error("%s return code %d.", command, request.status) + _LOGGER.error("%s return code %d", command, request.status) raise HassioAPIError() answer = await request.json() diff --git a/homeassistant/components/here_travel_time/sensor.py b/homeassistant/components/here_travel_time/sensor.py index f73d3bccaa6..afc6534d0c6 100644 --- a/homeassistant/components/here_travel_time/sensor.py +++ b/homeassistant/components/here_travel_time/sensor.py @@ -156,7 +156,7 @@ async def async_setup_platform( _are_valid_client_credentials, here_client ): _LOGGER.error( - "Invalid credentials. This error is returned if the specified token was invalid or no contract could be found for this token." + "Invalid credentials. This error is returned if the specified token was invalid or no contract could be found for this token" ) return diff --git a/homeassistant/components/home_connect/api.py b/homeassistant/components/home_connect/api.py index a208f9c7f0f..f768e28be92 100644 --- a/homeassistant/components/home_connect/api.py +++ b/homeassistant/components/home_connect/api.py @@ -69,7 +69,7 @@ class ConfigEntryAuth(homeconnect.HomeConnectAPI): elif app.type == "Hob": device = Hob(self.hass, app) else: - _LOGGER.warning("Appliance type %s not implemented.", app.type) + _LOGGER.warning("Appliance type %s not implemented", app.type) continue devices.append({"device": device, "entities": device.get_entity_info()}) self.devices = devices @@ -93,15 +93,15 @@ class HomeConnectDevice: try: self.appliance.get_status() except (HomeConnectError, ValueError): - _LOGGER.debug("Unable to fetch appliance status. Probably offline.") + _LOGGER.debug("Unable to fetch appliance status. Probably offline") try: self.appliance.get_settings() except (HomeConnectError, ValueError): - _LOGGER.debug("Unable to fetch settings. Probably offline.") + _LOGGER.debug("Unable to fetch settings. Probably offline") try: program_active = self.appliance.get_programs_active() except (HomeConnectError, ValueError): - _LOGGER.debug("Unable to fetch active programs. Probably offline.") + _LOGGER.debug("Unable to fetch active programs. Probably offline") program_active = None if program_active and "key" in program_active: self.appliance.status[BSH_ACTIVE_PROGRAM] = {"value": program_active["key"]} diff --git a/homeassistant/components/homekit/__init__.py b/homeassistant/components/homekit/__init__.py index 0d0531a986e..eef7ae88656 100644 --- a/homeassistant/components/homekit/__init__.py +++ b/homeassistant/components/homekit/__init__.py @@ -191,7 +191,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): # If the previous instance hasn't cleaned up yet # we need to wait a bit if not await hass.async_add_executor_job(port_is_available, port): - _LOGGER.warning("The local port %s is in use.", port) + _LOGGER.warning("The local port %s is in use", port) raise ConfigEntryNotReady if CONF_ENTRY_INDEX in conf and conf[CONF_ENTRY_INDEX] == 0: @@ -266,7 +266,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): if not await hass.async_add_executor_job( port_is_available, entry.data[CONF_PORT] ): - _LOGGER.info("Waiting for the HomeKit server to shutdown.") + _LOGGER.info("Waiting for the HomeKit server to shutdown") await asyncio.sleep(1) hass.data[DOMAIN].pop(entry.entry_id) @@ -310,7 +310,7 @@ def _async_register_events_and_services(hass: HomeAssistant): if homekit.status != STATUS_RUNNING: _LOGGER.warning( "HomeKit is not running. Either it is waiting to be " - "started or has been stopped." + "started or has been stopped" ) continue @@ -336,7 +336,7 @@ def _async_register_events_and_services(hass: HomeAssistant): if homekit.status != STATUS_READY: _LOGGER.warning( "HomeKit is not ready. Either it is already starting up or has " - "been stopped." + "been stopped" ) continue await homekit.async_start() @@ -436,7 +436,7 @@ class HomeKit: # The bridge itself counts as an accessory if len(self.bridge.accessories) + 1 >= MAX_DEVICES: _LOGGER.warning( - "Cannot add %s as this would exceeded the %d device limit. Consider using the filter option.", + "Cannot add %s as this would exceeded the %d device limit. Consider using the filter option", state.entity_id, MAX_DEVICES, ) diff --git a/homeassistant/components/homekit/accessories.py b/homeassistant/components/homekit/accessories.py index 65e9b7cc822..feced5d11ac 100644 --- a/homeassistant/components/homekit/accessories.py +++ b/homeassistant/components/homekit/accessories.py @@ -129,7 +129,7 @@ def get_accessory(hass, driver, state, aid, config): if not aid: _LOGGER.warning( 'The entity "%s" is not supported, since it ' - "generates an invalid aid, please change it.", + "generates an invalid aid, please change it", state.entity_id, ) return None diff --git a/homeassistant/components/homekit/img_util.py b/homeassistant/components/homekit/img_util.py index 88217bf776d..235cfe60df5 100644 --- a/homeassistant/components/homekit/img_util.py +++ b/homeassistant/components/homekit/img_util.py @@ -61,6 +61,6 @@ class TurboJPEGSingleton: TurboJPEGSingleton.__instance = TurboJPEG() except Exception: # pylint: disable=broad-except _LOGGER.exception( - "libturbojpeg is not installed, cameras may impact HomeKit performance." + "libturbojpeg is not installed, cameras may impact HomeKit performance" ) TurboJPEGSingleton.__instance = False diff --git a/homeassistant/components/homekit/type_cameras.py b/homeassistant/components/homekit/type_cameras.py index e25c5189262..8849a75ec37 100644 --- a/homeassistant/components/homekit/type_cameras.py +++ b/homeassistant/components/homekit/type_cameras.py @@ -357,17 +357,17 @@ class Camera(HomeAccessory, PyhapCamera): self._async_stop_ffmpeg_watch() if not pid_is_alive(stream.process.pid): - _LOGGER.info("[%s] Stream already stopped.", session_id) + _LOGGER.info("[%s] Stream already stopped", session_id) return True for shutdown_method in ["close", "kill"]: - _LOGGER.info("[%s] %s stream.", session_id, shutdown_method) + _LOGGER.info("[%s] %s stream", session_id, shutdown_method) try: await getattr(stream, shutdown_method)() return except Exception: # pylint: disable=broad-except _LOGGER.exception( - "[%s] Failed to %s stream.", session_id, shutdown_method + "[%s] Failed to %s stream", session_id, shutdown_method ) async def reconfigure_stream(self, session_info, stream_config): diff --git a/homeassistant/components/homekit/type_media_players.py b/homeassistant/components/homekit/type_media_players.py index 886c15a5fb9..8999382eb58 100644 --- a/homeassistant/components/homekit/type_media_players.py +++ b/homeassistant/components/homekit/type_media_players.py @@ -336,7 +336,7 @@ class TelevisionMediaPlayer(HomeAccessory): input_type = 3 if "hdmi" in source.lower() else 0 serv_input.configure_char(CHAR_INPUT_SOURCE_TYPE, value=input_type) serv_input.configure_char(CHAR_CURRENT_VISIBILITY_STATE, value=False) - _LOGGER.debug("%s: Added source %s.", self.entity_id, source) + _LOGGER.debug("%s: Added source %s", self.entity_id, source) self.async_update_state(state) diff --git a/homeassistant/components/homekit/type_thermostats.py b/homeassistant/components/homekit/type_thermostats.py index c202191cb7e..9ef5ae7fa0a 100644 --- a/homeassistant/components/homekit/type_thermostats.py +++ b/homeassistant/components/homekit/type_thermostats.py @@ -334,7 +334,7 @@ class Thermostat(HomeAccessory): if not hc_modes: # This cannot be none OR an empty list _LOGGER.error( - "%s: HVAC modes not yet available. Please disable auto start for homekit.", + "%s: HVAC modes not yet available. Please disable auto start for homekit", self.entity_id, ) hc_modes = ( diff --git a/homeassistant/components/homekit/util.py b/homeassistant/components/homekit/util.py index c578e3ea76c..c79b97adb87 100644 --- a/homeassistant/components/homekit/util.py +++ b/homeassistant/components/homekit/util.py @@ -306,7 +306,7 @@ class HomeKitSpeedMapping: _LOGGER.warning( "%s does not contain the speed setting " "%s as its first element. " - "Assuming that %s is equivalent to 'off'.", + "Assuming that %s is equivalent to 'off'", speed_list, fan.SPEED_OFF, speed_list[0], diff --git a/homeassistant/components/homekit_controller/connection.py b/homeassistant/components/homekit_controller/connection.py index d910de34321..9d8eb00b547 100644 --- a/homeassistant/components/homekit_controller/connection.py +++ b/homeassistant/components/homekit_controller/connection.py @@ -275,7 +275,7 @@ class HKDevice: async def async_update(self, now=None): """Poll state of all entities attached to this bridge/accessory.""" if not self.pollable_characteristics: - _LOGGER.debug("HomeKit connection not polling any characteristics.") + _LOGGER.debug("HomeKit connection not polling any characteristics") return if self._polling_lock.locked(): diff --git a/homeassistant/components/homematicip_cloud/alarm_control_panel.py b/homeassistant/components/homematicip_cloud/alarm_control_panel.py index 7e06cd60536..b53e0363a6a 100644 --- a/homeassistant/components/homematicip_cloud/alarm_control_panel.py +++ b/homeassistant/components/homematicip_cloud/alarm_control_panel.py @@ -105,7 +105,7 @@ class HomematicipAlarmControlPanelEntity(AlarmControlPanelEntity): self.async_write_ha_state() else: _LOGGER.debug( - "Device Changed Event for %s (Alarm Control Panel) not fired. Entity is disabled.", + "Device Changed Event for %s (Alarm Control Panel) not fired. Entity is disabled", self.name, ) diff --git a/homeassistant/components/homematicip_cloud/device.py b/homeassistant/components/homematicip_cloud/device.py index c2b67758152..91bec464a29 100644 --- a/homeassistant/components/homematicip_cloud/device.py +++ b/homeassistant/components/homematicip_cloud/device.py @@ -111,7 +111,7 @@ class HomematicipGenericDevice(Entity): self.async_write_ha_state() else: _LOGGER.debug( - "Device Changed Event for %s (%s) not fired. Entity is disabled.", + "Device Changed Event for %s (%s) not fired. Entity is disabled", self.name, self._device.modelType, ) diff --git a/homeassistant/components/http/data_validator.py b/homeassistant/components/http/data_validator.py index 1c9e796dc86..8f3e9a3e1e2 100644 --- a/homeassistant/components/http/data_validator.py +++ b/homeassistant/components/http/data_validator.py @@ -45,7 +45,7 @@ class RequestDataValidator: data = await request.json() except ValueError: if not self._allow_empty or (await request.content.read()) != b"": - _LOGGER.error("Invalid JSON received.") + _LOGGER.error("Invalid JSON received") return view.json_message("Invalid JSON.", HTTP_BAD_REQUEST) data = {} diff --git a/homeassistant/components/hue/bridge.py b/homeassistant/components/hue/bridge.py index 546b0368c8d..7602125b36f 100644 --- a/homeassistant/components/hue/bridge.py +++ b/homeassistant/components/hue/bridge.py @@ -153,7 +153,7 @@ class HueBridge: client_exceptions.ServerDisconnectedError, ) as err: if tries == 3: - _LOGGER.error("Request failed %s times, giving up.", tries) + _LOGGER.error("Request failed %s times, giving up", tries) raise # We only retry if it's a server error. So raise on all 4XX errors. diff --git a/homeassistant/components/ifttt/__init__.py b/homeassistant/components/ifttt/__init__.py index cb1bb9f64cf..4c579033fff 100644 --- a/homeassistant/components/ifttt/__init__.py +++ b/homeassistant/components/ifttt/__init__.py @@ -76,7 +76,7 @@ async def async_setup(hass, config): for target, key in target_keys.items(): res = pyfttt.send_event(key, event, value1, value2, value3) if res.status_code != HTTP_OK: - _LOGGER.error("IFTTT reported error sending event to %s.", target) + _LOGGER.error("IFTTT reported error sending event to %s", target) except requests.exceptions.RequestException: _LOGGER.exception("Error communicating with IFTTT") diff --git a/homeassistant/components/islamic_prayer_times/__init__.py b/homeassistant/components/islamic_prayer_times/__init__.py index 90a31890d16..5f47c7dc372 100644 --- a/homeassistant/components/islamic_prayer_times/__init__.py +++ b/homeassistant/components/islamic_prayer_times/__init__.py @@ -155,7 +155,7 @@ class IslamicPrayerClient: self.available = True except (exceptions.InvalidResponseError, ConnError): self.available = False - _LOGGER.debug("Error retrieving prayer times.") + _LOGGER.debug("Error retrieving prayer times") async_call_later(self.hass, 60, self.async_update) return @@ -165,7 +165,7 @@ class IslamicPrayerClient: ) await self.async_schedule_future_update() - _LOGGER.debug("New prayer times retrieved. Updating sensors.") + _LOGGER.debug("New prayer times retrieved. Updating sensors") async_dispatcher_send(self.hass, DATA_UPDATED) async def async_setup(self): diff --git a/homeassistant/components/isy994/__init__.py b/homeassistant/components/isy994/__init__.py index ffeb6079e5d..6399cbe46e1 100644 --- a/homeassistant/components/isy994/__init__.py +++ b/homeassistant/components/isy994/__init__.py @@ -181,7 +181,7 @@ async def async_setup_entry( def _start_auto_update() -> None: """Start isy auto update.""" - _LOGGER.debug("ISY Starting Event Stream and automatic updates.") + _LOGGER.debug("ISY Starting Event Stream and automatic updates") isy.auto_update = True await hass.async_add_executor_job(_start_auto_update) @@ -257,7 +257,7 @@ async def async_unload_entry( def _stop_auto_update() -> None: """Start isy auto update.""" - _LOGGER.debug("ISY Stopping Event Stream and automatic updates.") + _LOGGER.debug("ISY Stopping Event Stream and automatic updates") isy.auto_update = False await hass.async_add_executor_job(_stop_auto_update) diff --git a/homeassistant/components/isy994/binary_sensor.py b/homeassistant/components/isy994/binary_sensor.py index 3b5de4b8eca..dc32fcef230 100644 --- a/homeassistant/components/isy994/binary_sensor.py +++ b/homeassistant/components/isy994/binary_sensor.py @@ -107,7 +107,7 @@ async def async_setup_entry( if not parent_device: _LOGGER.error( "Node %s has a parent node %s, but no device " - "was created for the parent. Skipping.", + "was created for the parent. Skipping", node.address, node.parent_node, ) diff --git a/homeassistant/components/isy994/entity.py b/homeassistant/components/isy994/entity.py index a8805dc12cd..95bd43facde 100644 --- a/homeassistant/components/isy994/entity.py +++ b/homeassistant/components/isy994/entity.py @@ -157,7 +157,7 @@ class ISYNodeEntity(ISYEntity): """Respond to an entity service command call.""" if not hasattr(self._node, command): _LOGGER.error( - "Invalid Service Call %s for device %s.", command, self.entity_id + "Invalid Service Call %s for device %s", command, self.entity_id ) return getattr(self._node, command)() @@ -168,7 +168,7 @@ class ISYNodeEntity(ISYEntity): """Respond to an entity service raw command call.""" if not hasattr(self._node, "send_cmd"): _LOGGER.error( - "Invalid Service Call %s for device %s.", command, self.entity_id + "Invalid Service Call %s for device %s", command, self.entity_id ) return self._node.send_cmd(command, value, unit_of_measurement, parameters) diff --git a/homeassistant/components/isy994/helpers.py b/homeassistant/components/isy994/helpers.py index c8e39ec605d..a2550f6746c 100644 --- a/homeassistant/components/isy994/helpers.py +++ b/homeassistant/components/isy994/helpers.py @@ -330,7 +330,7 @@ def _categorize_programs(hass_isy_data: dict, programs: Programs) -> None: status = entity_folder.get_by_name(KEY_STATUS) if not status or not status.protocol == PROTO_PROGRAM: _LOGGER.warning( - "Program %s entity '%s' not loaded, invalid/missing status program.", + "Program %s entity '%s' not loaded, invalid/missing status program", platform, entity_folder.name, ) @@ -340,7 +340,7 @@ def _categorize_programs(hass_isy_data: dict, programs: Programs) -> None: actions = entity_folder.get_by_name(KEY_ACTIONS) if not actions or not actions.protocol == PROTO_PROGRAM: _LOGGER.warning( - "Program %s entity '%s' not loaded, invalid/missing actions program.", + "Program %s entity '%s' not loaded, invalid/missing actions program", platform, entity_folder.name, ) diff --git a/homeassistant/components/isy994/services.py b/homeassistant/components/isy994/services.py index f9004ecdfef..f59db1f5716 100644 --- a/homeassistant/components/isy994/services.py +++ b/homeassistant/components/isy994/services.py @@ -211,7 +211,7 @@ def async_setup_services(hass: HomeAssistantType): await hass.async_add_executor_job(command.run) return _LOGGER.error( - "Could not run network resource command. Not found or enabled on the ISY." + "Could not run network resource command. Not found or enabled on the ISY" ) async def async_send_program_command_service_handler(service): @@ -233,9 +233,7 @@ def async_setup_services(hass: HomeAssistantType): if program is not None: await hass.async_add_executor_job(getattr(program, command)) return - _LOGGER.error( - "Could not send program command. Not found or enabled on the ISY." - ) + _LOGGER.error("Could not send program command. Not found or enabled on the ISY") async def async_set_variable_service_handler(service): """Handle a set variable service call.""" @@ -258,7 +256,7 @@ def async_setup_services(hass: HomeAssistantType): if variable is not None: await hass.async_add_executor_job(variable.set_value, value, init) return - _LOGGER.error("Could not set variable value. Not found or enabled on the ISY.") + _LOGGER.error("Could not set variable value. Not found or enabled on the ISY") async def async_cleanup_registry_entries(service) -> None: """Remove extra entities that are no longer part of the integration.""" @@ -369,7 +367,7 @@ def async_unload_services(hass: HomeAssistantType): ): return - _LOGGER.info("Unloading ISY994 Services.") + _LOGGER.info("Unloading ISY994 Services") hass.services.async_remove(domain=DOMAIN, service=SERVICE_SYSTEM_QUERY) hass.services.async_remove(domain=DOMAIN, service=SERVICE_RUN_NETWORK_RESOURCE) hass.services.async_remove(domain=DOMAIN, service=SERVICE_SEND_PROGRAM_COMMAND) diff --git a/homeassistant/components/isy994/switch.py b/homeassistant/components/isy994/switch.py index 0f79d3f218f..68a3bdeecd2 100644 --- a/homeassistant/components/isy994/switch.py +++ b/homeassistant/components/isy994/switch.py @@ -45,12 +45,12 @@ class ISYSwitchEntity(ISYNodeEntity, SwitchEntity): def turn_off(self, **kwargs) -> None: """Send the turn off command to the ISY994 switch.""" if not self._node.turn_off(): - _LOGGER.debug("Unable to turn off switch.") + _LOGGER.debug("Unable to turn off switch") def turn_on(self, **kwargs) -> None: """Send the turn on command to the ISY994 switch.""" if not self._node.turn_on(): - _LOGGER.debug("Unable to turn on switch.") + _LOGGER.debug("Unable to turn on switch") @property def icon(self) -> str: diff --git a/homeassistant/components/kiwi/lock.py b/homeassistant/components/kiwi/lock.py index 79971d5aa93..047eaa1ed3c 100644 --- a/homeassistant/components/kiwi/lock.py +++ b/homeassistant/components/kiwi/lock.py @@ -42,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): available_locks = kiwi.get_locks() if not available_locks: # No locks found; abort setup routine. - _LOGGER.info("No KIWI locks found in your account.") + _LOGGER.info("No KIWI locks found in your account") return add_entities([KiwiLock(lock, kiwi) for lock in available_locks], True) diff --git a/homeassistant/components/konnected/__init__.py b/homeassistant/components/konnected/__init__.py index 56ab439aee3..bbc7226cf9f 100644 --- a/homeassistant/components/konnected/__init__.py +++ b/homeassistant/components/konnected/__init__.py @@ -346,7 +346,7 @@ class KonnectedView(HomeAssistantView): _LOGGER.error( "Your Konnected device software may be out of " "date. Visit https://help.konnected.io for " - "updating instructions." + "updating instructions" ) device = data[CONF_DEVICES].get(device_id) diff --git a/homeassistant/components/lcn/__init__.py b/homeassistant/components/lcn/__init__.py index 14f25be70b0..9cf91695d56 100644 --- a/homeassistant/components/lcn/__init__.py +++ b/homeassistant/components/lcn/__init__.py @@ -248,7 +248,7 @@ async def async_setup(hass, config): connections.append(connection) _LOGGER.info('LCN connected to "%s"', connection_name) except TimeoutError: - _LOGGER.error('Connection to PCHK server "%s" failed.', connection_name) + _LOGGER.error('Connection to PCHK server "%s" failed', connection_name) return False hass.data[DATA_LCN][CONF_CONNECTIONS] = connections diff --git a/homeassistant/components/lifx/light.py b/homeassistant/components/lifx/light.py index 26a2acfa517..a6dbdb557dc 100644 --- a/homeassistant/components/lifx/light.py +++ b/homeassistant/components/lifx/light.py @@ -163,7 +163,7 @@ def aiolifx_effects(): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the LIFX light platform. Obsolete.""" - _LOGGER.warning("LIFX no longer works with light platform configuration.") + _LOGGER.warning("LIFX no longer works with light platform configuration") async def async_setup_entry(hass, config_entry, async_add_entities): diff --git a/homeassistant/components/lovelace/__init__.py b/homeassistant/components/lovelace/__init__.py index 9b944be556b..b9ddef67768 100644 --- a/homeassistant/components/lovelace/__init__.py +++ b/homeassistant/components/lovelace/__init__.py @@ -225,7 +225,7 @@ async def create_yaml_resource_col(hass, yaml_resources): else: if CONF_RESOURCES in ll_conf: _LOGGER.warning( - "Resources need to be specified in your configuration.yaml. Please see the docs." + "Resources need to be specified in your configuration.yaml. Please see the docs" ) yaml_resources = ll_conf[CONF_RESOURCES] diff --git a/homeassistant/components/matrix/__init__.py b/homeassistant/components/matrix/__init__.py index f8a57572d04..c89de5552d5 100644 --- a/homeassistant/components/matrix/__init__.py +++ b/homeassistant/components/matrix/__init__.py @@ -289,7 +289,7 @@ class MatrixBot: if self._mx_id in self._auth_tokens: try: client = self._login_by_token() - _LOGGER.debug("Logged in using stored token.") + _LOGGER.debug("Logged in using stored token") except MatrixRequestError as ex: _LOGGER.warning( @@ -302,7 +302,7 @@ class MatrixBot: if not client: try: client = self._login_by_password() - _LOGGER.debug("Logged in using password.") + _LOGGER.debug("Logged in using password") except MatrixRequestError as ex: _LOGGER.error( diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index 9ba37e6c18a..24b1b570476 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -906,7 +906,7 @@ async def websocket_handle_thumbnail(hass, connection, msg): return _LOGGER.warning( - "The websocket command media_player_thumbnail is deprecated. Use /api/media_player_proxy instead." + "The websocket command media_player_thumbnail is deprecated. Use /api/media_player_proxy instead" ) data, content_type = await player.async_get_media_image() diff --git a/homeassistant/components/miflora/sensor.py b/homeassistant/components/miflora/sensor.py index 187f883187f..8ed4d02ea1d 100644 --- a/homeassistant/components/miflora/sensor.py +++ b/homeassistant/components/miflora/sensor.py @@ -79,7 +79,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the MiFlora sensor.""" backend = BACKEND - _LOGGER.debug("Miflora is using %s backend.", backend.__name__) + _LOGGER.debug("Miflora is using %s backend", backend.__name__) cache = config.get(CONF_SCAN_INTERVAL, SCAN_INTERVAL).total_seconds() poller = miflora_poller.MiFloraPoller( diff --git a/homeassistant/components/mitemp_bt/sensor.py b/homeassistant/components/mitemp_bt/sensor.py index b2033757693..745ede3b9e8 100644 --- a/homeassistant/components/mitemp_bt/sensor.py +++ b/homeassistant/components/mitemp_bt/sensor.py @@ -72,7 +72,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the MiTempBt sensor.""" backend = BACKEND - _LOGGER.debug("MiTempBt is using %s backend.", backend.__name__) + _LOGGER.debug("MiTempBt is using %s backend", backend.__name__) cache = config.get(CONF_CACHE) poller = mitemp_bt_poller.MiTempBtPoller( diff --git a/homeassistant/components/modem_callerid/sensor.py b/homeassistant/components/modem_callerid/sensor.py index 7ffda3e6124..c58a4b67eed 100644 --- a/homeassistant/components/modem_callerid/sensor.py +++ b/homeassistant/components/modem_callerid/sensor.py @@ -38,7 +38,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): modem = bm(port) if modem.state == modem.STATE_FAILED: - _LOGGER.error("Unable to initialize modem.") + _LOGGER.error("Unable to initialize modem") return add_entities([ModemCalleridSensor(hass, name, port, modem)]) diff --git a/homeassistant/components/nederlandse_spoorwegen/sensor.py b/homeassistant/components/nederlandse_spoorwegen/sensor.py index 39c05ff7cbf..dd43227a5ab 100644 --- a/homeassistant/components/nederlandse_spoorwegen/sensor.py +++ b/homeassistant/components/nederlandse_spoorwegen/sensor.py @@ -89,7 +89,7 @@ def valid_stations(stations, given_stations): if station is None: continue if not any(s.code == station.upper() for s in stations): - _LOGGER.warning("Station '%s' is not a valid station.", station) + _LOGGER.warning("Station '%s' is not a valid station", station) return False return True diff --git a/homeassistant/components/nest/__init__.py b/homeassistant/components/nest/__init__.py index 8ddd6da6dcf..185bf7c78ef 100644 --- a/homeassistant/components/nest/__init__.py +++ b/homeassistant/components/nest/__init__.py @@ -347,7 +347,7 @@ class NestDevice: _LOGGER.warning( "Cannot retrieve device name for [%s]" ", please check your Nest developer " - "account permission settings.", + "account permission settings", device.serial, ) continue diff --git a/homeassistant/components/nest/camera.py b/homeassistant/components/nest/camera.py index 34b4f6c5693..caa78a56a11 100644 --- a/homeassistant/components/nest/camera.py +++ b/homeassistant/components/nest/camera.py @@ -103,7 +103,7 @@ class NestCamera(Camera): def turn_on(self): """Turn on camera.""" if not self._online: - _LOGGER.error("Camera %s is offline.", self._name) + _LOGGER.error("Camera %s is offline", self._name) return _LOGGER.debug("Turn on camera %s", self._name) diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index 327d9ecc52f..aa382d52068 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -532,7 +532,7 @@ class NetatmoPublicData: return if data.CountStationInArea() == 0: - _LOGGER.warning("No Stations available in this area.") + _LOGGER.warning("No Stations available in this area") return self.data = data diff --git a/homeassistant/components/nissan_leaf/__init__.py b/homeassistant/components/nissan_leaf/__init__.py index a1e6d74b4f3..26689e5cb0a 100644 --- a/homeassistant/components/nissan_leaf/__init__.py +++ b/homeassistant/components/nissan_leaf/__init__.py @@ -165,7 +165,7 @@ def setup(hass, config): "WARNING: This may poll your Leaf too often, and drain the 12V" " battery. If you drain your cars 12V battery it WILL NOT START" " as the drive train battery won't connect." - " Don't set the intervals too low." + " Don't set the intervals too low" ) data_store = LeafDataStore(hass, leaf, car_config) diff --git a/homeassistant/components/openalpr_cloud/image_processing.py b/homeassistant/components/openalpr_cloud/image_processing.py index 8f04b0838fe..e8ae2d24029 100644 --- a/homeassistant/components/openalpr_cloud/image_processing.py +++ b/homeassistant/components/openalpr_cloud/image_processing.py @@ -122,7 +122,7 @@ class OpenAlprCloudEntity(ImageProcessingAlprEntity): data = await request.json() if request.status != HTTP_OK: - _LOGGER.error("Error %d -> %s.", request.status, data.get("error")) + _LOGGER.error("Error %d -> %s", request.status, data.get("error")) return except (asyncio.TimeoutError, aiohttp.ClientError): diff --git a/homeassistant/components/opnsense/__init__.py b/homeassistant/components/opnsense/__init__.py index 608bca0f03b..900eb327b36 100644 --- a/homeassistant/components/opnsense/__init__.py +++ b/homeassistant/components/opnsense/__init__.py @@ -52,7 +52,7 @@ def setup(hass, config): try: interfaces_client.get_arp() except APIException: - _LOGGER.exception("Failure while connecting to OPNsense API endpoint.") + _LOGGER.exception("Failure while connecting to OPNsense API endpoint") return False if tracker_interfaces: diff --git a/homeassistant/components/owntracks/messages.py b/homeassistant/components/owntracks/messages.py index 4d5995c558b..5e610d861fe 100644 --- a/homeassistant/components/owntracks/messages.py +++ b/homeassistant/components/owntracks/messages.py @@ -377,7 +377,7 @@ async def async_handle_not_impl_msg(hass, context, message): async def async_handle_unsupported_msg(hass, context, message): """Handle an unsupported or invalid message type.""" - _LOGGER.warning("Received unsupported message type: %s.", message.get("_type")) + _LOGGER.warning("Received unsupported message type: %s", message.get("_type")) async def async_handle_message(hass, context, message): diff --git a/homeassistant/components/persistent_notification/__init__.py b/homeassistant/components/persistent_notification/__init__.py index 54e252a97a5..9a1f35c947d 100644 --- a/homeassistant/components/persistent_notification/__init__.py +++ b/homeassistant/components/persistent_notification/__init__.py @@ -172,7 +172,7 @@ async def async_setup(hass: HomeAssistant, config: dict) -> bool: if entity_id not in persistent_notifications: _LOGGER.error( "Marking persistent_notification read failed: " - "Notification ID %s not found.", + "Notification ID %s not found", notification_id, ) return diff --git a/homeassistant/components/plaato/sensor.py b/homeassistant/components/plaato/sensor.py index 07b0453fca6..aee4358acdf 100644 --- a/homeassistant/components/plaato/sensor.py +++ b/homeassistant/components/plaato/sensor.py @@ -119,7 +119,7 @@ class PlaatoSensor(Entity): """Return the state of the sensor.""" sensors = self.get_sensors() if sensors is False: - _LOGGER.debug("Device with name %s has no sensors.", self.name) + _LOGGER.debug("Device with name %s has no sensors", self.name) return 0 if self._type == ATTR_ABV: diff --git a/homeassistant/components/plex/server.py b/homeassistant/components/plex/server.py index 4a09cf7d339..c7ec022c469 100644 --- a/homeassistant/components/plex/server.py +++ b/homeassistant/components/plex/server.py @@ -180,7 +180,7 @@ class PlexServer: f"hostname '{domain}' doesn't match" ): _LOGGER.warning( - "Plex SSL certificate's hostname changed, updating." + "Plex SSL certificate's hostname changed, updating" ) if _update_plexdirect_hostname(): config_entry_update_needed = True @@ -199,7 +199,7 @@ class PlexServer: system_accounts = self._plex_server.systemAccounts() except Unauthorized: _LOGGER.warning( - "Plex account has limited permissions, shared account filtering will not be available." + "Plex account has limited permissions, shared account filtering will not be available" ) else: self._accounts = [ diff --git a/homeassistant/components/poolsense/config_flow.py b/homeassistant/components/poolsense/config_flow.py index 3d4c37ef523..59fa8b5af0b 100644 --- a/homeassistant/components/poolsense/config_flow.py +++ b/homeassistant/components/poolsense/config_flow.py @@ -37,7 +37,7 @@ class PoolSenseConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): self._email = user_input[CONF_EMAIL] self._password = user_input[CONF_PASSWORD] - _LOGGER.debug("Configuring user: %s - Password hidden.", self._email) + _LOGGER.debug("Configuring user: %s - Password hidden", self._email) poolsense = PoolSense() api_key_valid = await poolsense.test_poolsense_credentials( diff --git a/homeassistant/components/quantum_gateway/device_tracker.py b/homeassistant/components/quantum_gateway/device_tracker.py index 58151fa02ce..08f8a5191c9 100644 --- a/homeassistant/components/quantum_gateway/device_tracker.py +++ b/homeassistant/components/quantum_gateway/device_tracker.py @@ -51,10 +51,10 @@ class QuantumGatewayDeviceScanner(DeviceScanner): self.success_init = self.quantum.success_init except RequestException: self.success_init = False - _LOGGER.error("Unable to connect to gateway. Check host.") + _LOGGER.error("Unable to connect to gateway. Check host") if not self.success_init: - _LOGGER.error("Unable to login to gateway. Check password and host.") + _LOGGER.error("Unable to login to gateway. Check password and host") def scan_devices(self): """Scan for new devices and return a list of found MACs.""" diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index 0d40cc0212f..c64b9429cf0 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -421,7 +421,7 @@ class Recorder(threading.Thread): except Exception as err: # pylint: disable=broad-except # Must catch the exception to prevent the loop from collapsing _LOGGER.error( - "Error in database connectivity during keepalive: %s.", err, + "Error in database connectivity during keepalive: %s", err, ) self._reopen_event_session() diff --git a/homeassistant/components/recorder/migration.py b/homeassistant/components/recorder/migration.py index ece0e36402e..d8b508ba513 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -165,7 +165,7 @@ def _drop_index(engine, table_name, index_name): _LOGGER.warning( "Failed to drop index %s from table %s. Schema " "Migration will continue; this is not a " - "critical operation.", + "critical operation", index_name, table_name, ) @@ -195,7 +195,7 @@ def _add_columns(engine, table_name, columns_def): except (InternalError, OperationalError): # Some engines support adding all columns at once, # this error is when they don't - _LOGGER.info("Unable to use quick column add. Adding 1 by 1.") + _LOGGER.info("Unable to use quick column add. Adding 1 by 1") for column_def in columns_def: try: diff --git a/homeassistant/components/recorder/purge.py b/homeassistant/components/recorder/purge.py index 19c2db47768..b80f4670c36 100644 --- a/homeassistant/components/recorder/purge.py +++ b/homeassistant/components/recorder/purge.py @@ -59,7 +59,7 @@ def purge_old_data(instance, purge_days: int, repack: bool) -> bool: # If states or events purging isn't processing the purge_before yet, # return false, as we are not done yet. if batch_purge_before != purge_before: - _LOGGER.debug("Purging hasn't fully completed yet.") + _LOGGER.debug("Purging hasn't fully completed yet") return False # Recorder runs is small, no need to batch run it @@ -94,7 +94,7 @@ def purge_old_data(instance, purge_days: int, repack: bool) -> bool: time.sleep(instance.db_retry_wait) return False - _LOGGER.warning("Error purging history: %s.", err) + _LOGGER.warning("Error purging history: %s", err) except SQLAlchemyError as err: - _LOGGER.warning("Error purging history: %s.", err) + _LOGGER.warning("Error purging history: %s", err) return True diff --git a/homeassistant/components/rest/sensor.py b/homeassistant/components/rest/sensor.py index 0ed62abd001..2c8df9625cd 100644 --- a/homeassistant/components/rest/sensor.py +++ b/homeassistant/components/rest/sensor.py @@ -216,7 +216,7 @@ class RestSensor(Entity): _LOGGER.debug("JSON converted from XML: %s", value) except ExpatError: _LOGGER.warning( - "REST xml result could not be parsed and converted to JSON." + "REST xml result could not be parsed and converted to JSON" ) _LOGGER.debug("Erroneous XML: %s", value) diff --git a/homeassistant/components/rest_command/__init__.py b/homeassistant/components/rest_command/__init__.py index dc7337c7569..f8b99c48a44 100644 --- a/homeassistant/components/rest_command/__init__.py +++ b/homeassistant/components/rest_command/__init__.py @@ -122,22 +122,22 @@ async def async_setup(hass, config): if response.status < HTTP_BAD_REQUEST: _LOGGER.debug( - "Success. Url: %s. Status code: %d.", + "Success. Url: %s. Status code: %d", response.url, response.status, ) else: _LOGGER.warning( - "Error. Url: %s. Status code %d.", + "Error. Url: %s. Status code %d", response.url, response.status, ) except asyncio.TimeoutError: - _LOGGER.warning("Timeout call %s.", response.url, exc_info=1) + _LOGGER.warning("Timeout call %s", response.url, exc_info=1) except aiohttp.ClientError: - _LOGGER.error("Client error %s.", request_url, exc_info=1) + _LOGGER.error("Client error %s", request_url, exc_info=1) # register services hass.services.async_register(DOMAIN, name, async_service_handler) diff --git a/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index b97cc17f6a8..03dd6a54e8f 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -231,7 +231,7 @@ async def _async_process_config(hass, config, component): entity_id = ENTITY_ID_FORMAT.format(service.service) script_entity = component.get_entity(entity_id) if script_entity.script.is_legacy and script_entity.is_on: - _LOGGER.warning("Script %s already running.", entity_id) + _LOGGER.warning("Script %s already running", entity_id) return await script_entity.async_turn_on( variables=service.data, context=service.context diff --git a/homeassistant/components/sensibo/climate.py b/homeassistant/components/sensibo/climate.py index 93d992d1d89..29aa0c5380e 100644 --- a/homeassistant/components/sensibo/climate.py +++ b/homeassistant/components/sensibo/climate.py @@ -101,7 +101,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= asyncio.TimeoutError, pysensibo.SensiboError, ): - _LOGGER.exception("Failed to connect to Sensibo servers.") + _LOGGER.exception("Failed to connect to Sensibo servers") raise PlatformNotReady if not devices: @@ -398,5 +398,5 @@ class SensiboClimate(ClimateEntity): data = await self._client.async_get_device(self._id, _FETCH_FIELDS) self._do_update(data) except (aiohttp.client_exceptions.ClientError, pysensibo.SensiboError): - _LOGGER.warning("Failed to connect to Sensibo servers.") + _LOGGER.warning("Failed to connect to Sensibo servers") self._available = False diff --git a/homeassistant/components/signal_messenger/notify.py b/homeassistant/components/signal_messenger/notify.py index cee871fb17e..a1a165e9608 100644 --- a/homeassistant/components/signal_messenger/notify.py +++ b/homeassistant/components/signal_messenger/notify.py @@ -65,7 +65,7 @@ class SignalNotificationService(BaseNotificationService): filenames = data[ATTR_FILENAMES] if ATTR_FILENAME in data: _LOGGER.warning( - "The 'attachment' option is deprecated, please replace it with 'attachments'. This option will become invalid in version 0.108." + "The 'attachment' option is deprecated, please replace it with 'attachments'. This option will become invalid in version 0.108" ) if filenames is None: filenames = [data[ATTR_FILENAME]] diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index a726c822cb0..8895244158a 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -524,7 +524,7 @@ class SimpliSafe: if isinstance(result, InvalidCredentialsError): if self._emergency_refresh_token_used: _LOGGER.error( - "SimpliSafe authentication disconnected. Please restart HASS." + "SimpliSafe authentication disconnected. Please restart HASS" ) remove_listener = self._hass.data[DOMAIN][DATA_LISTENER].pop( self._config_entry.entry_id diff --git a/homeassistant/components/smtp/notify.py b/homeassistant/components/smtp/notify.py index 1b7ae4ebdb7..30d7ea2645e 100644 --- a/homeassistant/components/smtp/notify.py +++ b/homeassistant/components/smtp/notify.py @@ -138,7 +138,7 @@ class MailNotificationService(BaseNotificationService): except (smtplib.socket.gaierror, ConnectionRefusedError): _LOGGER.exception( "SMTP server not found or refused connection (%s:%s). " - "Please check the IP address, hostname, and availability of your SMTP server.", + "Please check the IP address, hostname, and availability of your SMTP server", self._server, self._port, ) diff --git a/homeassistant/components/snips/__init__.py b/homeassistant/components/snips/__init__.py index 65015bd723c..618190e8e70 100644 --- a/homeassistant/components/snips/__init__.py +++ b/homeassistant/components/snips/__init__.py @@ -161,7 +161,7 @@ async def async_setup(hass, config): "Received unknown intent %s", request["intent"]["intentName"] ) except intent.IntentError: - _LOGGER.exception("Error while handling intent: %s.", intent_type) + _LOGGER.exception("Error while handling intent: %s", intent_type) await hass.components.mqtt.async_subscribe(INTENT_TOPIC, message_received) diff --git a/homeassistant/components/songpal/media_player.py b/homeassistant/components/songpal/media_player.py index 578cdaed367..ae633055b83 100644 --- a/homeassistant/components/songpal/media_player.py +++ b/homeassistant/components/songpal/media_player.py @@ -57,7 +57,7 @@ async def async_setup_platform( ) -> None: """Set up from legacy configuration file. Obsolete.""" _LOGGER.error( - "Configuring Songpal through media_player platform is no longer supported. Convert to songpal platform or UI configuration." + "Configuring Songpal through media_player platform is no longer supported. Convert to songpal platform or UI configuration" ) @@ -75,7 +75,7 @@ async def async_setup_entry( ): # set timeout to avoid blocking the setup process await device.get_supported_methods() except (SongpalException, asyncio.TimeoutError) as ex: - _LOGGER.warning("[%s(%s)] Unable to connect.", name, endpoint) + _LOGGER.warning("[%s(%s)] Unable to connect", name, endpoint) _LOGGER.debug("Unable to get methods from songpal: %s", ex) raise PlatformNotReady @@ -128,7 +128,7 @@ class SongpalEntity(MediaPlayerEntity): async def async_activate_websocket(self): """Activate websocket for listening if wanted.""" - _LOGGER.info("Activating websocket connection..") + _LOGGER.info("Activating websocket connection") async def _volume_changed(volume: VolumeChange): _LOGGER.debug("Volume changed: %s", volume) @@ -152,7 +152,7 @@ class SongpalEntity(MediaPlayerEntity): async def _try_reconnect(connect: ConnectChange): _LOGGER.warning( - "[%s(%s)] Got disconnected, trying to reconnect.", + "[%s(%s)] Got disconnected, trying to reconnect", self.name, self._dev.endpoint, ) @@ -179,7 +179,7 @@ class SongpalEntity(MediaPlayerEntity): self.hass.loop.create_task(self._dev.listen_notifications()) _LOGGER.warning( - "[%s(%s)] Connection reestablished.", self.name, self._dev.endpoint + "[%s(%s)] Connection reestablished", self.name, self._dev.endpoint ) self._dev.on_notification(VolumeChange, _volume_changed) diff --git a/homeassistant/components/sony_projector/switch.py b/homeassistant/components/sony_projector/switch.py index e14d74dd2c0..723478ac34b 100644 --- a/homeassistant/components/sony_projector/switch.py +++ b/homeassistant/components/sony_projector/switch.py @@ -80,18 +80,18 @@ class SonyProjector(SwitchEntity): def turn_on(self, **kwargs): """Turn the projector on.""" - _LOGGER.debug("Powering on projector '%s'...", self.name) + _LOGGER.debug("Powering on projector '%s'", self.name) if self._sdcp.set_power(True): - _LOGGER.debug("Powered on successfully.") + _LOGGER.debug("Powered on successfully") self._state = STATE_ON else: _LOGGER.error("Power on command was not successful") def turn_off(self, **kwargs): """Turn the projector off.""" - _LOGGER.debug("Powering off projector '%s'...", self.name) + _LOGGER.debug("Powering off projector '%s'", self.name) if self._sdcp.set_power(False): - _LOGGER.debug("Powered off successfully.") + _LOGGER.debug("Powered off successfully") self._state = STATE_OFF else: _LOGGER.error("Power off command was not successful") diff --git a/homeassistant/components/spc/__init__.py b/homeassistant/components/spc/__init__.py index 1601090463f..25520c9d42a 100644 --- a/homeassistant/components/spc/__init__.py +++ b/homeassistant/components/spc/__init__.py @@ -57,7 +57,7 @@ async def async_setup(hass, config): hass.data[DATA_API] = spc if not await spc.async_load_parameters(): - _LOGGER.error("Failed to load area/zone information from SPC.") + _LOGGER.error("Failed to load area/zone information from SPC") return False # add sensor devices for each zone (typically motion/fire/door sensors) diff --git a/homeassistant/components/squeezebox/media_player.py b/homeassistant/components/squeezebox/media_player.py index 74dfc42f210..88fba2f6ccf 100644 --- a/homeassistant/components/squeezebox/media_player.py +++ b/homeassistant/components/squeezebox/media_player.py @@ -512,7 +512,7 @@ class SqueezeBoxEntity(MediaPlayerEntity): if other_player_id: await self._player.async_sync(other_player_id) else: - _LOGGER.info("Could not find player_id for %s. Not syncing.", other_player) + _LOGGER.info("Could not find player_id for %s. Not syncing", other_player) async def async_unsync(self): """Unsync this Squeezebox player.""" diff --git a/homeassistant/components/statistics/sensor.py b/homeassistant/components/statistics/sensor.py index 906b0a2c68b..d5fcfbf31ae 100644 --- a/homeassistant/components/statistics/sensor.py +++ b/homeassistant/components/statistics/sensor.py @@ -225,7 +225,7 @@ class StatisticsSensor(Entity): async def async_update(self): """Get the latest data and updates the states.""" - _LOGGER.debug("%s: updating statistics.", self.entity_id) + _LOGGER.debug("%s: updating statistics", self.entity_id) if self._max_age is not None: self._purge_old() @@ -323,7 +323,7 @@ class StatisticsSensor(Entity): ) query = query.filter(States.last_updated >= records_older_then) else: - _LOGGER.debug("%s: retrieving all records.", self.entity_id) + _LOGGER.debug("%s: retrieving all records", self.entity_id) query = query.order_by(States.last_updated.desc()).limit( self._sampling_size diff --git a/homeassistant/components/stream/__init__.py b/homeassistant/components/stream/__init__.py index ab80630cb33..198a154cb9c 100644 --- a/homeassistant/components/stream/__init__.py +++ b/homeassistant/components/stream/__init__.py @@ -101,7 +101,7 @@ async def async_setup(hass, config): for stream in hass.data[DOMAIN][ATTR_STREAMS].values(): stream.keepalive = False stream.stop() - _LOGGER.info("Stopped stream workers.") + _LOGGER.info("Stopped stream workers") hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shutdown) diff --git a/homeassistant/components/suez_water/sensor.py b/homeassistant/components/suez_water/sensor.py index bfa529adb34..3bca3484298 100644 --- a/homeassistant/components/suez_water/sensor.py +++ b/homeassistant/components/suez_water/sensor.py @@ -122,4 +122,4 @@ class SuezSensor(Entity): def update(self): """Return the latest collected data from Linky.""" self._fetch_data() - _LOGGER.debug("Suez data state is: %s.", self._state) + _LOGGER.debug("Suez data state is: %s", self._state) diff --git a/homeassistant/components/tado/__init__.py b/homeassistant/components/tado/__init__.py index 1261311c767..f2273bcae10 100644 --- a/homeassistant/components/tado/__init__.py +++ b/homeassistant/components/tado/__init__.py @@ -202,7 +202,7 @@ class TadoConnector: elif sensor_type == "device": devices_data = self.tado.getDevices() if not devices_data: - _LOGGER.info("There are no devices to setup on this tado account.") + _LOGGER.info("There are no devices to setup on this tado account") return data = devices_data[0] diff --git a/homeassistant/components/tado/device_tracker.py b/homeassistant/components/tado/device_tracker.py index 5d87bfe8e34..8de938af985 100644 --- a/homeassistant/components/tado/device_tracker.py +++ b/homeassistant/components/tado/device_tracker.py @@ -115,7 +115,7 @@ class TadoDeviceScanner(DeviceScanner): response = await self.websession.get(url) if response.status != HTTP_OK: - _LOGGER.warning("Error %d on %s.", response.status, self.tadoapiurl) + _LOGGER.warning("Error %d on %s", response.status, self.tadoapiurl) return False tado_json = await response.json() diff --git a/homeassistant/components/tcp/sensor.py b/homeassistant/components/tcp/sensor.py index 5d457f2df7b..9eee857fd83 100644 --- a/homeassistant/components/tcp/sensor.py +++ b/homeassistant/components/tcp/sensor.py @@ -124,7 +124,7 @@ class TcpSensor(Entity): if not readable: _LOGGER.warning( "Timeout (%s second(s)) waiting for a response after " - "sending %r to %s on port %s.", + "sending %r to %s on port %s", self._config[CONF_TIMEOUT], self._config[CONF_PAYLOAD], self._config[CONF_HOST], diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index 277f9108663..cb22487ba63 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -596,9 +596,7 @@ class TelegramNotificationService: message = kwargs.get(ATTR_MESSAGE) title = kwargs.get(ATTR_TITLE) text = f"{title}\n{message}" if title else message - _LOGGER.debug( - "Editing message with ID %s.", message_id or inline_message_id - ) + _LOGGER.debug("Editing message with ID %s", message_id or inline_message_id) return self._send_msg( self.bot.editMessageText, "Error editing text message", @@ -628,7 +626,7 @@ class TelegramNotificationService: """Answer a callback originated with a press in an inline keyboard.""" params = self._get_msg_kwargs(kwargs) _LOGGER.debug( - "Answer callback query with callback ID %s: %s, alert: %s.", + "Answer callback query with callback ID %s: %s, alert: %s", callback_query_id, message, show_alert, @@ -663,7 +661,7 @@ class TelegramNotificationService: ) if file_content: for chat_id in self._get_target_chat_ids(target): - _LOGGER.debug("Send file to chat ID %s. Caption: %s.", chat_id, caption) + _LOGGER.debug("Send file to chat ID %s. Caption: %s", chat_id, caption) self._send_msg( func_send, "Error sending file", @@ -683,7 +681,7 @@ class TelegramNotificationService: params = self._get_msg_kwargs(kwargs) for chat_id in self._get_target_chat_ids(target): _LOGGER.debug( - "Send location %s/%s to chat ID %s.", latitude, longitude, chat_id + "Send location %s/%s to chat ID %s", latitude, longitude, chat_id ) self._send_msg( self.bot.sendLocation, diff --git a/homeassistant/components/tellduslive/__init__.py b/homeassistant/components/tellduslive/__init__.py index 917b927691e..ae98a5d8504 100644 --- a/homeassistant/components/tellduslive/__init__.py +++ b/homeassistant/components/tellduslive/__init__.py @@ -81,7 +81,7 @@ async def async_setup_entry(hass, entry): async def async_new_client(hass, session, entry): """Add the hubs associated with the current client to device_registry.""" interval = entry.data[KEY_SCAN_INTERVAL] - _LOGGER.debug("Update interval %s seconds.", interval) + _LOGGER.debug("Update interval %s seconds", interval) client = TelldusLiveClient(hass, entry, session, interval) hass.data[DOMAIN] = client dev_reg = await hass.helpers.device_registry.async_get_registry() diff --git a/homeassistant/components/template/__init__.py b/homeassistant/components/template/__init__.py index 11ad02975ee..04808970af2 100644 --- a/homeassistant/components/template/__init__.py +++ b/homeassistant/components/template/__init__.py @@ -46,7 +46,7 @@ def extract_entities( "Template %s '%s' has no entity ids configured to track nor" " were we able to extract the entities to track from the %s " "template(s). This entity will only be able to be updated " - "manually.", + "manually", device_type, device_name, ", ".join(invalid_templates), diff --git a/homeassistant/components/template/binary_sensor.py b/homeassistant/components/template/binary_sensor.py index 94d0f9d597b..91ffba6dd25 100644 --- a/homeassistant/components/template/binary_sensor.py +++ b/homeassistant/components/template/binary_sensor.py @@ -255,7 +255,7 @@ class BinarySensorTemplate(BinarySensorEntity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render %s template %s, the state is unknown.", + "Could not render %s template %s, the state is unknown", friendly_property_name, self._name, ) diff --git a/homeassistant/components/template/cover.py b/homeassistant/components/template/cover.py index e8bdebe2f58..16140de67d8 100644 --- a/homeassistant/components/template/cover.py +++ b/homeassistant/components/template/cover.py @@ -447,7 +447,7 @@ class CoverTemplate(CoverEntity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render %s template %s, the state is unknown.", + "Could not render %s template %s, the state is unknown", friendly_property_name, self._name, ) diff --git a/homeassistant/components/template/fan.py b/homeassistant/components/template/fan.py index 14381b82e62..ecdb4ec7eec 100644 --- a/homeassistant/components/template/fan.py +++ b/homeassistant/components/template/fan.py @@ -272,7 +272,7 @@ class TemplateFan(FanEntity): ) else: _LOGGER.error( - "Received invalid speed: %s. Expected: %s.", speed, self._speed_list + "Received invalid speed: %s. Expected: %s", speed, self._speed_list ) async def async_oscillate(self, oscillating: bool) -> None: @@ -287,7 +287,7 @@ class TemplateFan(FanEntity): ) else: _LOGGER.error( - "Received invalid oscillating value: %s. Expected: %s.", + "Received invalid oscillating value: %s. Expected: %s", oscillating, ", ".join(_VALID_OSC), ) @@ -304,7 +304,7 @@ class TemplateFan(FanEntity): ) else: _LOGGER.error( - "Received invalid direction: %s. Expected: %s.", + "Received invalid direction: %s. Expected: %s", direction, ", ".join(_VALID_DIRECTIONS), ) @@ -345,7 +345,7 @@ class TemplateFan(FanEntity): self._state = None else: _LOGGER.error( - "Received invalid fan is_on state: %s. Expected: %s.", + "Received invalid fan is_on state: %s. Expected: %s", state, ", ".join(_VALID_STATES), ) @@ -367,7 +367,7 @@ class TemplateFan(FanEntity): self._speed = None else: _LOGGER.error( - "Received invalid speed: %s. Expected: %s.", speed, self._speed_list + "Received invalid speed: %s. Expected: %s", speed, self._speed_list ) self._speed = None @@ -389,7 +389,7 @@ class TemplateFan(FanEntity): self._oscillating = None else: _LOGGER.error( - "Received invalid oscillating: %s. Expected: True/False.", + "Received invalid oscillating: %s. Expected: True/False", oscillating, ) self._oscillating = None @@ -410,7 +410,7 @@ class TemplateFan(FanEntity): self._direction = None else: _LOGGER.error( - "Received invalid direction: %s. Expected: %s.", + "Received invalid direction: %s. Expected: %s", direction, ", ".join(_VALID_DIRECTIONS), ) diff --git a/homeassistant/components/template/light.py b/homeassistant/components/template/light.py index df0a095cdd1..d96c6f62dce 100644 --- a/homeassistant/components/template/light.py +++ b/homeassistant/components/template/light.py @@ -395,7 +395,7 @@ class LightTemplate(LightEntity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render %s template %s, the state is unknown.", + "Could not render %s template %s, the state is unknown", friendly_property_name, self._name, ) diff --git a/homeassistant/components/template/sensor.py b/homeassistant/components/template/sensor.py index 0ca5571515a..44f83699097 100644 --- a/homeassistant/components/template/sensor.py +++ b/homeassistant/components/template/sensor.py @@ -230,7 +230,7 @@ class SensorTemplate(Entity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render template %s, the state is unknown.", self._name + "Could not render template %s, the state is unknown", self._name ) else: self._state = None @@ -268,7 +268,7 @@ class SensorTemplate(Entity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render %s template %s, the state is unknown.", + "Could not render %s template %s, the state is unknown", friendly_property_name, self._name, ) diff --git a/homeassistant/components/template/switch.py b/homeassistant/components/template/switch.py index 0ec0eca553a..03609e23dc6 100644 --- a/homeassistant/components/template/switch.py +++ b/homeassistant/components/template/switch.py @@ -228,7 +228,7 @@ class SwitchTemplate(SwitchEntity): ): # Common during HA startup - so just a warning _LOGGER.warning( - "Could not render %s template %s, the state is unknown.", + "Could not render %s template %s, the state is unknown", friendly_property_name, self._name, ) diff --git a/homeassistant/components/template/vacuum.py b/homeassistant/components/template/vacuum.py index 0a1a0e50ffc..040b4324b05 100644 --- a/homeassistant/components/template/vacuum.py +++ b/homeassistant/components/template/vacuum.py @@ -332,7 +332,7 @@ class TemplateVacuum(StateVacuumEntity): ) else: _LOGGER.error( - "Received invalid fan speed: %s. Expected: %s.", + "Received invalid fan speed: %s. Expected: %s", fan_speed, self._fan_speed_list, ) @@ -378,7 +378,7 @@ class TemplateVacuum(StateVacuumEntity): self._state = None else: _LOGGER.error( - "Received invalid vacuum state: %s. Expected: %s.", + "Received invalid vacuum state: %s. Expected: %s", state, ", ".join(_VALID_STATES), ) @@ -417,7 +417,7 @@ class TemplateVacuum(StateVacuumEntity): self._fan_speed = None else: _LOGGER.error( - "Received invalid fan speed: %s. Expected: %s.", + "Received invalid fan speed: %s. Expected: %s", fan_speed, self._fan_speed_list, ) diff --git a/homeassistant/components/tesla/__init__.py b/homeassistant/components/tesla/__init__.py index 0b5f366817a..82c98518f48 100644 --- a/homeassistant/components/tesla/__init__.py +++ b/homeassistant/components/tesla/__init__.py @@ -152,7 +152,7 @@ async def async_setup_entry(hass, config_entry): "devices": defaultdict(list), DATA_LISTENER: [config_entry.add_update_listener(update_listener)], } - _LOGGER.debug("Connected to the Tesla API.") + _LOGGER.debug("Connected to the Tesla API") all_devices = entry_data["controller"].get_homeassistant_components() if not all_devices: diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index 8dd5c507d7d..323267cae6f 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -113,7 +113,7 @@ class TibberSensorElPrice(TibberSensor): or (self._tibber_home.last_data_timestamp - now).total_seconds() / 3600 < 12 or not self._is_available ): - _LOGGER.debug("Asking for new data.") + _LOGGER.debug("Asking for new data") await self._fetch_data() res = self._tibber_home.current_price_data() diff --git a/homeassistant/components/tmb/sensor.py b/homeassistant/components/tmb/sensor.py index 8eb0673aa73..f731b912d65 100644 --- a/homeassistant/components/tmb/sensor.py +++ b/homeassistant/components/tmb/sensor.py @@ -116,5 +116,5 @@ class TMBSensor(Entity): self._state = self._ibus_client.get_stop_forecast(self._stop, self._line) except HTTPError: _LOGGER.error( - "Unable to fetch data from TMB API. Please check your API keys are valid." + "Unable to fetch data from TMB API. Please check your API keys are valid" ) diff --git a/homeassistant/components/tplink/common.py b/homeassistant/components/tplink/common.py index 0e06babbd52..7ecced32341 100644 --- a/homeassistant/components/tplink/common.py +++ b/homeassistant/components/tplink/common.py @@ -184,7 +184,7 @@ async def async_add_entities_retry( result = False if result is True or result is None: - _LOGGER.debug("Added object.") + _LOGGER.debug("Added object") add_objects.remove(add_object) else: _LOGGER.debug("Failed to add object, will try again later") diff --git a/homeassistant/components/tplink_lte/__init__.py b/homeassistant/components/tplink_lte/__init__.py index e495a14a38c..7ea7e24dbb9 100644 --- a/homeassistant/components/tplink_lte/__init__.py +++ b/homeassistant/components/tplink_lte/__init__.py @@ -146,7 +146,7 @@ async def _login(hass, modem_data, password): async def _retry_login(hass, modem_data, password): """Sleep and retry setup.""" - _LOGGER.warning("Could not connect to %s. Will keep trying.", modem_data.host) + _LOGGER.warning("Could not connect to %s. Will keep trying", modem_data.host) modem_data.connected = False delay = 15 diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index 4a522b76b8e..e2304fc7f63 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -147,7 +147,7 @@ async def async_setup_entry(hass, entry): async def async_poll_devices_update(event_time): """Check if accesstoken is expired and pull device list from server.""" - _LOGGER.debug("Pull devices from Tuya.") + _LOGGER.debug("Pull devices from Tuya") # Add new discover device. device_list = await hass.async_add_executor_job(_get_updated_devices) await async_load_devices(device_list) diff --git a/homeassistant/components/unifi_direct/device_tracker.py b/homeassistant/components/unifi_direct/device_tracker.py index 558a9981171..0594adb1a3c 100644 --- a/homeassistant/components/unifi_direct/device_tracker.py +++ b/homeassistant/components/unifi_direct/device_tracker.py @@ -133,5 +133,5 @@ def _response_to_json(response): return active_clients except (ValueError, TypeError): - _LOGGER.error("Failed to decode response from AP.") + _LOGGER.error("Failed to decode response from AP") return {} diff --git a/homeassistant/components/upcloud/__init__.py b/homeassistant/components/upcloud/__init__.py index cd2cf5d02c0..2daa50a22b0 100644 --- a/homeassistant/components/upcloud/__init__.py +++ b/homeassistant/components/upcloud/__init__.py @@ -73,7 +73,7 @@ def setup(hass, config): manager.authenticate() hass.data[DATA_UPCLOUD] = UpCloud(manager) except upcloud_api.UpCloudAPIError: - _LOGGER.error("Authentication failed.") + _LOGGER.error("Authentication failed") return False def upcloud_update(event_time): diff --git a/homeassistant/components/upnp/config_flow.py b/homeassistant/components/upnp/config_flow.py index a85e47c5919..6d85ba94270 100644 --- a/homeassistant/components/upnp/config_flow.py +++ b/homeassistant/components/upnp/config_flow.py @@ -120,7 +120,7 @@ class UpnpFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): # Ensure anything to add. If not, silently abort. if not self._discoveries: - _LOGGER.info("No UPnP devices discovered, aborting.") + _LOGGER.info("No UPnP devices discovered, aborting") return self.async_abort(reason="no_devices_found") discovery = self._discoveries[0] diff --git a/homeassistant/components/vicare/__init__.py b/homeassistant/components/vicare/__init__.py index d498ada704d..2b1a367215b 100644 --- a/homeassistant/components/vicare/__init__.py +++ b/homeassistant/components/vicare/__init__.py @@ -81,7 +81,7 @@ def setup(hass, config): vicare_api = Device(conf[CONF_USERNAME], conf[CONF_PASSWORD], **params) except AttributeError: _LOGGER.error( - "Failed to create PyViCare API client. Please check your credentials." + "Failed to create PyViCare API client. Please check your credentials" ) return False diff --git a/homeassistant/components/vizio/config_flow.py b/homeassistant/components/vizio/config_flow.py index da4c7cc8b13..a0fe5a6fa31 100644 --- a/homeassistant/components/vizio/config_flow.py +++ b/homeassistant/components/vizio/config_flow.py @@ -256,7 +256,7 @@ class VizioConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): _LOGGER.warning( "Couldn't complete configuration.yaml import: '%s' key is " "missing. Either provide '%s' key in configuration.yaml or " - "finish setup by completing configuration via frontend.", + "finish setup by completing configuration via frontend", CONF_ACCESS_TOKEN, CONF_ACCESS_TOKEN, ) diff --git a/homeassistant/components/voicerss/tts.py b/homeassistant/components/voicerss/tts.py index 52a3f9f1b1c..23d4c9ff864 100644 --- a/homeassistant/components/voicerss/tts.py +++ b/homeassistant/components/voicerss/tts.py @@ -177,7 +177,7 @@ class VoiceRSSProvider(Provider): if request.status != HTTP_OK: _LOGGER.error( - "Error %d on load url %s.", request.status, request.url + "Error %d on load url %s", request.status, request.url ) return (None, None) data = await request.read() diff --git a/homeassistant/components/waqi/sensor.py b/homeassistant/components/waqi/sensor.py index 8f16c216b37..cdac719d890 100644 --- a/homeassistant/components/waqi/sensor.py +++ b/homeassistant/components/waqi/sensor.py @@ -81,7 +81,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= } & set(station_filter): dev.append(waqi_sensor) except (aiohttp.client_exceptions.ClientConnectorError, asyncio.TimeoutError): - _LOGGER.exception("Failed to connect to WAQI servers.") + _LOGGER.exception("Failed to connect to WAQI servers") raise PlatformNotReady async_add_entities(dev, True) diff --git a/homeassistant/components/waterfurnace/__init__.py b/homeassistant/components/waterfurnace/__init__.py index 2ec77e35070..8f237f2fc5a 100644 --- a/homeassistant/components/waterfurnace/__init__.py +++ b/homeassistant/components/waterfurnace/__init__.py @@ -49,7 +49,7 @@ def setup(hass, base_config): try: wfconn.login() except WFCredentialError: - _LOGGER.error("Invalid credentials for waterfurnace login.") + _LOGGER.error("Invalid credentials for waterfurnace login") return False hass.data[DOMAIN] = WaterFurnaceData(hass, wfconn) @@ -85,10 +85,10 @@ class WaterFurnaceData(threading.Thread): self._fails += 1 if self._fails > MAX_FAILS: - _LOGGER.error("Failed to refresh login credentials. Thread stopped.") + _LOGGER.error("Failed to refresh login credentials. Thread stopped") self.hass.components.persistent_notification.create( "Error:
Connection to waterfurnace website failed " - "the maximum number of times. Thread has stopped.", + "the maximum number of times. Thread has stopped", title=NOTIFICATION_TITLE, notification_id=NOTIFICATION_ID, ) @@ -118,7 +118,7 @@ class WaterFurnaceData(threading.Thread): def shutdown(event): """Shutdown the thread.""" - _LOGGER.debug("Signaled to shutdown.") + _LOGGER.debug("Signaled to shutdown") self._shutdown = True self.join() diff --git a/homeassistant/components/wink/climate.py b/homeassistant/components/wink/climate.py index 28be557c65e..7ee05f0a729 100644 --- a/homeassistant/components/wink/climate.py +++ b/homeassistant/components/wink/climate.py @@ -254,7 +254,7 @@ class WinkThermostat(WinkDevice, ClimateEntity): except KeyError: _LOGGER.error( "Invalid operation mode mapping. %s doesn't map. " - "Please report this.", + "Please report this", mode, ) return hvac_list @@ -457,7 +457,7 @@ class WinkAC(WinkDevice, ClimateEntity): except KeyError: _LOGGER.error( "Invalid operation mode mapping. %s doesn't map. " - "Please report this.", + "Please report this", mode, ) return hvac_list diff --git a/homeassistant/components/wirelesstag/__init__.py b/homeassistant/components/wirelesstag/__init__.py index d4d60e220c6..2c2add94527 100644 --- a/homeassistant/components/wirelesstag/__init__.py +++ b/homeassistant/components/wirelesstag/__init__.py @@ -92,7 +92,7 @@ class WirelessTagPlatform: def make_notifications(self, binary_sensors, mac): """Create configurations for push notifications.""" - _LOGGER.info("Creating configurations for push notifications.") + _LOGGER.info("Creating configurations for push notifications") configs = [] bi_url = self.binary_event_callback_url @@ -108,7 +108,7 @@ class WirelessTagPlatform: def install_push_notifications(self, binary_sensors): """Register local push notification from tag manager.""" - _LOGGER.info("Registering local push notifications.") + _LOGGER.info("Registering local push notifications") for mac in self.tag_manager_macs: configs = self.make_notifications(binary_sensors, mac) # install notifications for all tags in tag manager @@ -122,9 +122,7 @@ class WirelessTagPlatform: ) else: _LOGGER.info( - "Installed push notifications for all\ - tags in %s.", - mac, + "Installed push notifications for all tags in %s", mac, ) @property diff --git a/homeassistant/components/withings/__init__.py b/homeassistant/components/withings/__init__.py index 29fca81ca79..94795a10c83 100644 --- a/homeassistant/components/withings/__init__.py +++ b/homeassistant/components/withings/__init__.py @@ -183,11 +183,11 @@ async def async_webhook_handler( return Response() if request.method.upper() != "POST": - return json_message_response("Invalid method.", message_code=2) + return json_message_response("Invalid method", message_code=2) # Handle http post calls to the path. if not request.body_exists: - return json_message_response("No request body.", message_code=12) + return json_message_response("No request body", message_code=12) params = await request.post() @@ -204,7 +204,7 @@ async def async_webhook_handler( data_manager = get_data_manager_by_webhook_id(hass, webhook_id) if not data_manager: _LOGGER.error( - "Webhook id %s not handled by data manager. This is a bug and should be reported.", + "Webhook id %s not handled by data manager. This is a bug and should be reported", webhook_id, ) return json_message_response("User not found", message_code=1) diff --git a/homeassistant/components/withings/common.py b/homeassistant/components/withings/common.py index 30b67fac566..d63cdffcca6 100644 --- a/homeassistant/components/withings/common.py +++ b/homeassistant/components/withings/common.py @@ -652,14 +652,14 @@ class DataManager: return await self._do_retry(self._async_subscribe_webhook) async def _async_subscribe_webhook(self) -> None: - _LOGGER.debug("Configuring withings webhook.") + _LOGGER.debug("Configuring withings webhook") # On first startup, perform a fresh re-subscribe. Withings stops pushing data # if the webhook fails enough times but they don't remove the old subscription # config. This ensures the subscription is setup correctly and they start # pushing again. if self._subscribe_webhook_run_count == 0: - _LOGGER.debug("Refreshing withings webhook configs.") + _LOGGER.debug("Refreshing withings webhook configs") await self.async_unsubscribe_webhook() self._subscribe_webhook_run_count += 1 @@ -758,7 +758,7 @@ class DataManager: raise exception async def _async_get_all_data(self) -> Optional[Dict[MeasureType, Any]]: - _LOGGER.info("Updating all withings data.") + _LOGGER.info("Updating all withings data") return { **await self.async_get_measures(), **await self.async_get_sleep_summary(), diff --git a/homeassistant/components/xbee/__init__.py b/homeassistant/components/xbee/__init__.py index 31e2d6dc495..a0f6bc69a0d 100644 --- a/homeassistant/components/xbee/__init__.py +++ b/homeassistant/components/xbee/__init__.py @@ -305,7 +305,7 @@ class XBeeDigitalIn(Entity): pin_name = xb_const.DIGITAL_PINS[self._config.pin] if pin_name not in sample: _LOGGER.warning( - "Pin %s (%s) was not in the sample provided by Zigbee device %s.", + "Pin %s (%s) was not in the sample provided by Zigbee device %s", self._config.pin, pin_name, hexlify(self._config.address), diff --git a/homeassistant/components/xiaomi_aqara/binary_sensor.py b/homeassistant/components/xiaomi_aqara/binary_sensor.py index 44dc6706d57..1145f1afa5c 100644 --- a/homeassistant/components/xiaomi_aqara/binary_sensor.py +++ b/homeassistant/components/xiaomi_aqara/binary_sensor.py @@ -249,7 +249,7 @@ class XiaomiMotionSensor(XiaomiBinarySensor): "Skipping heartbeat of the motion sensor. " "It can introduce an incorrect state because of a firmware " "bug (https://github.com/home-assistant/home-assistant/pull/" - "11631#issuecomment-357507744)." + "11631#issuecomment-357507744)" ) return diff --git a/homeassistant/components/xiaomi_miio/remote.py b/homeassistant/components/xiaomi_miio/remote.py index 6fbf4b8a0f6..1f3ce573339 100644 --- a/homeassistant/components/xiaomi_miio/remote.py +++ b/homeassistant/components/xiaomi_miio/remote.py @@ -221,14 +221,14 @@ class XiaomiMiioRemote(RemoteEntity): """Turn the device on.""" _LOGGER.error( "Device does not support turn_on, " - "please use 'remote.send_command' to send commands." + "please use 'remote.send_command' to send commands" ) async def async_turn_off(self, **kwargs): """Turn the device off.""" _LOGGER.error( "Device does not support turn_off, " - "please use 'remote.send_command' to send commands." + "please use 'remote.send_command' to send commands" ) def _send_command(self, payload): diff --git a/homeassistant/components/xmpp/notify.py b/homeassistant/components/xmpp/notify.py index 0aba4a8bd15..7388c11f70f 100644 --- a/homeassistant/components/xmpp/notify.py +++ b/homeassistant/components/xmpp/notify.py @@ -298,10 +298,10 @@ async def async_send_message( async def upload_file_from_path(self, path, timeout=None): """Upload a file from a local file path via XEP_0363.""" - _LOGGER.info("Uploading file from path, %s ...", path) + _LOGGER.info("Uploading file from path, %s", path) if not hass.config.is_allowed_path(path): - raise PermissionError("Could not access file. Not in whitelist.") + raise PermissionError("Could not access file. Not in whitelist") with open(path, "rb") as upfile: _LOGGER.debug("Reading file %s", path) diff --git a/homeassistant/components/yeelight/light.py b/homeassistant/components/yeelight/light.py index 0f622837bfb..fef6857a384 100644 --- a/homeassistant/components/yeelight/light.py +++ b/homeassistant/components/yeelight/light.py @@ -652,7 +652,7 @@ class YeelightGenericLight(LightEntity): """Activate flash.""" if flash: if self._bulb.last_properties["color_mode"] != 1: - _LOGGER.error("Flash supported currently only in RGB mode.") + _LOGGER.error("Flash supported currently only in RGB mode") return transition = int(self.config[CONF_TRANSITION]) diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index f8149782db6..4e0598fed95 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -514,7 +514,7 @@ async def async_setup_entry(hass, config_entry): _LOGGER.info( "Z-Wave network is ready for use. All awake nodes " "have been queried. Sleeping nodes will be " - "queried when they awake." + "queried when they awake" ) hass.bus.fire(const.EVENT_NETWORK_READY) @@ -826,7 +826,7 @@ async def async_setup_entry(hass, config_entry): ) return _LOGGER.info( - "Node %s on instance %s does not have resettable meters.", node_id, instance + "Node %s on instance %s does not have resettable meters", node_id, instance ) def heal_node(service): @@ -842,7 +842,7 @@ async def async_setup_entry(hass, config_entry): node_id = service.data.get(const.ATTR_NODE_ID) messages = service.data.get(const.ATTR_MESSAGES) node = network.nodes[node_id] - _LOGGER.info("Sending %s test-messages to node %s.", messages, node_id) + _LOGGER.info("Sending %s test-messages to node %s", messages, node_id) node.test(messages) def start_zwave(_service_or_event): @@ -1079,7 +1079,7 @@ class ZWaveDeviceEntityValues: if workaround_component and workaround_component != component: if workaround_component == workaround.WORKAROUND_IGNORE: _LOGGER.info( - "Ignoring Node %d Value %d due to workaround.", + "Ignoring Node %d Value %d due to workaround", self.primary.node.node_id, self.primary.value_id, ) diff --git a/homeassistant/components/zwave/light.py b/homeassistant/components/zwave/light.py index 1856aeb9623..244b4a557e1 100644 --- a/homeassistant/components/zwave/light.py +++ b/homeassistant/components/zwave/light.py @@ -209,7 +209,7 @@ class ZwaveDimmer(ZWaveDeviceEntity, LightEntity): """ if self.values.dimming_duration is None: if ATTR_TRANSITION in kwargs: - _LOGGER.debug("Dimming not supported by %s.", self.entity_id) + _LOGGER.debug("Dimming not supported by %s", self.entity_id) return if ATTR_TRANSITION not in kwargs: @@ -221,11 +221,11 @@ class ZwaveDimmer(ZWaveDeviceEntity, LightEntity): self.values.dimming_duration.data = int(transition) elif transition > 7620: self.values.dimming_duration.data = 0xFE - _LOGGER.warning("Transition clipped to 127 minutes for %s.", self.entity_id) + _LOGGER.warning("Transition clipped to 127 minutes for %s", self.entity_id) else: minutes = int(transition / 60) _LOGGER.debug( - "Transition rounded to %d minutes for %s.", minutes, self.entity_id + "Transition rounded to %d minutes for %s", minutes, self.entity_id ) self.values.dimming_duration.data = minutes + 0x7F diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 68442689d3b..d707546a8cc 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -230,7 +230,7 @@ class ConfigEntry: wait_time = 2 ** min(tries, 4) * 5 tries += 1 _LOGGER.warning( - "Config entry for %s not ready yet. Retrying in %d seconds.", + "Config entry for %s not ready yet. Retrying in %d seconds", self.domain, wait_time, ) diff --git a/homeassistant/core.py b/homeassistant/core.py index 9e0b1514ab5..60579f43e28 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -288,7 +288,7 @@ class HomeAssistant: if self.state != CoreState.starting: _LOGGER.warning( "Home Assistant startup has been interrupted. " - "Its state may be inconsistent." + "Its state may be inconsistent" ) return @@ -1152,7 +1152,7 @@ class ServiceRegistry: service = service.lower() if service not in self._services.get(domain, {}): - _LOGGER.warning("Unable to remove unknown service %s/%s.", domain, service) + _LOGGER.warning("Unable to remove unknown service %s/%s", domain, service) return self._services[domain].pop(service) diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 6a14c6e1ef7..8414bb912c2 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -297,7 +297,7 @@ class Entity(ABC): self._disabled_reported = True assert self.platform is not None _LOGGER.warning( - "Entity %s is incorrectly being triggered for updates while it is disabled. This is a bug in the %s integration.", + "Entity %s is incorrectly being triggered for updates while it is disabled. This is a bug in the %s integration", self.entity_id, self.platform.platform_name, ) diff --git a/homeassistant/helpers/intent.py b/homeassistant/helpers/intent.py index 8fdf617e3f6..df5e40911ff 100644 --- a/homeassistant/helpers/intent.py +++ b/homeassistant/helpers/intent.py @@ -39,7 +39,7 @@ def async_register(hass: HomeAssistantType, handler: "IntentHandler") -> None: if handler.intent_type in intents: _LOGGER.warning( - "Intent %s is being overwritten by %s.", handler.intent_type, handler + "Intent %s is being overwritten by %s", handler.intent_type, handler ) intents[handler.intent_type] = handler diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index 2c4f02990bf..80164d34b69 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -486,7 +486,7 @@ async def _handle_entity_call(hass, entity, func, data, context): if asyncio.iscoroutine(result): _LOGGER.error( - "Service %s for %s incorrectly returns a coroutine object. Await result instead in service handler. Report bug to integration author.", + "Service %s for %s incorrectly returns a coroutine object. Await result instead in service handler. Report bug to integration author", func, entity.entity_id, ) diff --git a/homeassistant/setup.py b/homeassistant/setup.py index dedcc27e44e..3395baa3e86 100644 --- a/homeassistant/setup.py +++ b/homeassistant/setup.py @@ -194,7 +194,7 @@ async def _async_setup_component( except asyncio.TimeoutError: _LOGGER.error( "Setup of %s is taking longer than %s seconds." - " Startup will proceed without waiting any longer.", + " Startup will proceed without waiting any longer", domain, SLOW_SETUP_MAX_WAIT, ) @@ -209,7 +209,7 @@ async def _async_setup_component( end = timer() if warn_task: warn_task.cancel() - _LOGGER.info("Setup of domain %s took %.1f seconds.", domain, end - start) + _LOGGER.info("Setup of domain %s took %.1f seconds", domain, end - start) if result is False: log_error("Integration failed to initialize.") diff --git a/homeassistant/util/yaml/loader.py b/homeassistant/util/yaml/loader.py index 8d713bf494f..982446597e5 100644 --- a/homeassistant/util/yaml/loader.py +++ b/homeassistant/util/yaml/loader.py @@ -207,7 +207,7 @@ def _ordered_dict(loader: SafeLineLoader, node: yaml.nodes.MappingNode) -> Order if key in seen: fname = getattr(loader.stream, "name", "") _LOGGER.warning( - 'YAML file %s contains duplicate key "%s". ' "Check lines %d and %d.", + 'YAML file %s contains duplicate key "%s". Check lines %d and %d', fname, key, seen[key], @@ -233,7 +233,7 @@ def _env_var_yaml(loader: SafeLineLoader, node: yaml.nodes.Node) -> str: return os.getenv(args[0], " ".join(args[1:])) if args[0] in os.environ: return os.environ[args[0]] - _LOGGER.error("Environment variable %s not defined.", node.value) + _LOGGER.error("Environment variable %s not defined", node.value) raise HomeAssistantError(node.value) diff --git a/tests/components/config/test_zwave.py b/tests/components/config/test_zwave.py index 75a66f61939..8b83583d1f5 100644 --- a/tests/components/config/test_zwave.py +++ b/tests/components/config/test_zwave.py @@ -338,7 +338,7 @@ async def test_save_config(hass, client): assert resp.status == 200 result = await resp.json() assert network.write_config.called - assert result == {"message": "Z-Wave configuration saved to file."} + assert result == {"message": "Z-Wave configuration saved to file"} async def test_get_protection_values(hass, client): diff --git a/tests/components/signal_messenger/test_notify.py b/tests/components/signal_messenger/test_notify.py index a44be249f22..b4239dacfab 100644 --- a/tests/components/signal_messenger/test_notify.py +++ b/tests/components/signal_messenger/test_notify.py @@ -91,7 +91,7 @@ class TestSignalMesssenger(unittest.TestCase): data = {"data": {"attachment": tf.name}} self._signalmessenger.send_message(message, **data) self.assertIn( - "The 'attachment' option is deprecated, please replace it with 'attachments'. This option will become invalid in version 0.108.", + "The 'attachment' option is deprecated, please replace it with 'attachments'. This option will become invalid in version 0.108", context.output[0], ) self.assertTrue(mock.called) diff --git a/tests/components/songpal/test_media_player.py b/tests/components/songpal/test_media_player.py index e4d03d03b0a..61b59ee1b56 100644 --- a/tests/components/songpal/test_media_player.py +++ b/tests/components/songpal/test_media_player.py @@ -260,6 +260,6 @@ async def test_disconnected(hass, caplog): await notification_callbacks[ConnectChange](connect_change) warning_records = [x for x in caplog.records if x.levelno == logging.WARNING] assert len(warning_records) == 2 - assert warning_records[0].message.endswith("Got disconnected, trying to reconnect.") - assert warning_records[1].message.endswith("Connection reestablished.") + assert warning_records[0].message.endswith("Got disconnected, trying to reconnect") + assert warning_records[1].message.endswith("Connection reestablished") assert not any(x.levelno == logging.ERROR for x in caplog.records)