diff --git a/homeassistant/auth/providers/command_line.py b/homeassistant/auth/providers/command_line.py index e6300085299b3570f811deca26888c284695bc7b..961e1014c5edbd637c3fdd4169a73628bf313fb9 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 90e0f32226c33cd399fa71f646f766a39a74a728..31e937a0fe7bcab397b854ab776cf6b1a4fbcdbe 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 95dbd0c35320e79523ef2464f5c81932e586250b..84e86bfcabaf7982f8d8530383d6192f8270ec83 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 78d2769ce5de94d529348d1147d3aaefb4c3bdcf..44aab11573d04aa16d0d69d58040123338c4046a 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 178f31ee87a72018257eaadc93c4e652ef6849d8..0aa9fcc29eca49c800c7cc2617ca22d0add893ef 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 090481876da23e93fd01b299424aabeb7b9de594..433b2929602796cd11b9e203ea14e0935492ec33 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 b595bc98589b4c5075050eb278cf7b7658142d90..6c9b9ac5180191e3512ba48105e0321622f1d376 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 1f024bf58823f4bb6f006b49d6442e34fcc623c2..181f70d725acb1f2ff5744054c5b8f524f275381 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 fb29a0ac8c714e8189bd28f0f8ddf685381e8d62..1ce34c8a7518c9f5d12ccd3101cd3ce4d5475a85 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 3cc0ec607a5e8b17b4444c9c3914d7f20ede2ad0..4338d3bab7e35c5ea9150e3ecd77aef8513b7333 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 d9c87beea5d98eb461281e4d2c08eb1754eb4e60..1829d00a353cb26b166307ec64558b3107dacf6b 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 f9dd6b2dd6129046a21b29d9229b3137ca68e69d..1a8585653fe08874e5687af2e340470feb274b63 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 1b25564b8a6c197548962fe9c9103bd0b71d6616..9e0222dc81d3e01768fc48c93829c93fdf6f6bc1 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 6602cfe866130a9b271d70be2980dd09821c3b9c..226cbf655f996d15463447f597d02822a7e58061 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 433742da5842e9fb61f3414a35feba0ad855470c..642c1d5678db3d2ec0fc194b5b356b9e6bce331b 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 b99ae97aa618e54f3934311d250716053f93007e..c72d1ce40feb6768a775f2e290f08ec900f72eb9 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 83c20ea10888902245f623de9881ce04106c479d..7f36874c40ef2e5c55ff4e17ac04146ddf4af09c 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 4c69678d215d97cea19904cb12ba75772af01de0..e64925bf19e445f885dfa3f938d79ce228c4ab2c 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 fb33bef7d525cea2a9ca4327cf82c3742fc88cbe..2e49b50651b28bca5babc4fba418bbac606e1273 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 9266709a83a17c67d079e12d40eac7c1e27a2bd3..341ba0c4c5ef5794dd64de00a3bc648db322206a 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 3883c5ad725aaca4145d1bf0e7eb802a5d7e73bd..43622124aa178a42a6235e09493f69d6964c87a2 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 2ae3de49817b28817099507299591a28257cc127..f3fe240c0bca376045dba835912e9e20ab1cb059 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 b8331d8192b80370a349ffa07fd7c085f758c3e1..edc2e9af42c98a828d3b8c5aa2f3a803b6cd503b 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 6f716d3a5dc9dce738a544f772ea69437c2afbab..93693b3d52a04b2cdfae4f6407b37bd424ab6815 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 92ff25e7cf0f0272e6532b18eb0b78165fb749b0..8f9ef2a3ed8dc2e59704376d53b6574362b2098e 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 022878c8276dcdd7c264f7e015bcea905af5d86b..67c195da3e62b62379bd19b9b95aeb93acf1aefd 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 14e3cf11ca2119067a1da334d56a92e5263e1465..ecb7824177127d092163ab3ce07be4a7d02bacc0 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 1aa07c83027c81bd7b23045fd31608e2ad4367cc..4813fd47a9246a40549ebe78b8804fde1ba3c388 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 14113537de6e98a3376c77abefac9a2d96c93d1f..636cf0c19df44b08ea8da7fade5368096898b40d 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 95571a825b2ec6bad5c722aa08f48861e883a52a..b1a210b8d1563212a94034d5e1cd7492a56c779e 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 e4d2cf00e71bdad3f03b16679a75383a5834157b..e436268db63ef26bb9d8b2b17eff881a33a4f239 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 dcbffe2a568b071a8b4b1457c57181d0f7be316b..fd2a9d39c00509c24601dc9321f60627b2e312ff 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 e0322ccbab7f60b154e1449ae44759a55cf527e7..b685d42acf66c6f47ee2856c20a7be92fbd25ab5 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 7f8934d9d65f07f9364480bdd047579f77c6ab73..00f87e21f47a3712fa0aef7b990c22b372917846 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 aec574d8d405616d247f532eec727bbb775be1a1..40ebee220bca90fe2afc00dd4101a00aa6ed9c52 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 78bf248c51b128436150f064a32cfbe86184e583..48713789c6eb216c85db920bf739b2f6cd2b54ed 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 4f1accec4e0058c8d9e621205b0845efef36b4c6..78ea1616f99f039ca39149e7a6a88b625d466e85 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 160ec024c8112b2ec72ed7a734ee5883bfbf0970..b1182b436b5832ff08b61862c21f7c95184c8f0f 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 7b48c12cc93d4af7ede240ef03f4d110374b87d9..b6bd6f71bf4490ae5c16fb402a6aae90347599a3 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 d5d8eb5773f2a34f879b8f512d8f42d7d453e46f..962c11a8cb3e8ec7fa54b9a504a7b835d43675dc 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 d427b2be60d39b4e9e877b53737eeeeafc8fa76b..f64461f70d384699cf9028a12f064fd32802c93d 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 b95690641cdcc2b0cd1ee2b32fcfbd7d139ae2d2..066219d77e8d8f3f8826db31e7b83d1ec5d7c5ac 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 9d3df7e8aecbd0f4a066c60fd6be8b69dcc97c5b..cce17695e30116b49c59c5681fcc7f1ba0aa1f49 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 f73d3bccaa66ceecd5d19e2515f4373f729193e3..afc6534d0c6b7e8aeea12f7bbdf116ef238920ed 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 a208f9c7f0f4d6c20826553203842a7b7381af04..f768e28be9238f5d99c97fbf3bd6569dedf67214 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 0d0531a986e2e58a990c1e40e2706bced9d63242..eef7ae8865685b9ad219b345c795c6a6c21fa20d 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 65e9b7cc8224acae6457e80469bab0d09ab5c19d..feced5d11ac5da35d903f2a9da6e567f115c3940 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 88217bf776d52a11efbfd7a7f1229465b0e6b0a0..235cfe60df588dd088e7e87ad58c9b899143b9ea 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 e25c5189262a961d7f9ff89fdaecaad9e675e339..8849a75ec378731d217141f547048b03598723dc 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 886c15a5fb92f0679fece9865de0da52ac22d678..8999382eb582b9a328d18fab45126e124138ee5c 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 c202191cb7e518646e35bda4e7772d4a58f84ffc..9ef5ae7fa0ac0d242db96a43d450f585cff5161e 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 c578e3ea76c279637cc1f24d797b7aa4e3efbbb0..c79b97adb870cd714ef89c81a7009e533ae89ae9 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 d910de3432127f827f67f7c755067e9da69f1908..9d8eb00b547ef5a7cd77cc4e042cb33b14d01637 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 7e06cd60536195df4e81471a3f259536624d11ea..b53e0363a6a65149cada882bda741a2402543ba1 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 c2b67758152a6b084b11d1d5be8d555c20662d03..91bec464a29e2cef8aa150cfd1b8d88755117205 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 1c9e796dc86d1364f8618a08a48a8884507f8d9f..8f3e9a3e1e2f6c6f613840fc8c3aede4a022798e 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 546b0368c8ddf5a4ef4d8d904f407495fc45b6cd..7602125b36f063f22ecb9cac48540636c3928df5 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 cb1bb9f64cf7716884c78a5653b8b85f8ab7020c..4c579033fff5084f66358b17f26b20677cc000cd 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 90a31890d162d043ec0c6138a9f4f01637edabec..5f47c7dc372c3bfd2e65ffdcd9ef37bc1c59d104 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 ffeb6079e5d4f262d25f5e6f478d468025e11033..6399cbe46e11ce09a3b952307a3572f835b661c9 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 3b5de4b8eca321c37528df02c422eb809d6eed6e..dc32fcef23041df02cba76fe0a5e585a24b40f59 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 a8805dc12cd6a6d9e023366c02b3cf216e50961d..95bd43facde0b635d25f6ee37377140127ddf361 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 c8e39ec605def334e8190e380e9611a58d4ed882..a2550f6746c0fafdd75f222cac61238116a50f54 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 f9004ecdfefc85e762521cbf8d642a94f3e44502..f59db1f57169872a840bb191494061accdb74736 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 0f79d3f218f38248cde00025ae73ecb8bdad6373..68a3bdeecd222c2396fd2c527685681bfa287c70 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 79971d5aa93d94bb98c10d959e696248cef2d5a6..047eaa1ed3c2c9efa59fab015e7e0a9c4c4c842a 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 56ab439aee37f1ee4bf61ca03fd2ccf8e520a7f9..bbc7226cf9f0afc8f7de29b12868cebdd43b8697 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 14f25be70b0d884892e7df176e961b753027479e..9cf91695d56411709f192c394d0018c84084ced9 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 26a2acfa51761aae18f64921ab3e3c70af7253d6..a6dbdb557dc73517d84d3a3d2d52f410c44277a3 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 9b944be556b1fbb5bf471f4012870aa711d58442..b9ddef677682a54a0056d7b5f53e6d9f8693779f 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 f8a57572d04a8b96a0d0b496b1a8683e623943b4..c89de5552d5bae68897de3f46d3426e889711ec4 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 9ba37e6c18ad593892ffaa2de548197ac3ec344d..24b1b570476704c3de517402226587cc24953f2c 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 187f883187f5e031f108edad5c9e09561914601c..8ed4d02ea1ddc091e0e4eba7cca6708ec560e0ea 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 b20337576934644d88b1848ffb1b624bff01e682..745ede3b9e8ebb7305a2111fc0761b3e102d0ade 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 7ffda3e61243fd9e026a314742c7f34310974176..c58a4b67eedb97957a28f78d5b12e6a27a63ca22 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 39c05ff7cbf148e57c6e051a69e0845a7be6ebb1..dd43227a5ab5218d77b57a1a56f2198f3bf3e65f 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 8ddd6da6dcffd0176d3e09fc204f2987e954cb26..185bf7c78ef5e66e47a5b3a1e5a9067e7b4b95c0 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 34b4f6c5693e15445cddce716d53ef02ef233108..caa78a56a117c7d29e76de2d50bdb06bbb61c84d 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 327d9ecc52feba6237c97c5ef5e60460de246955..aa382d520687f26c3f56cf7e54efee7afff6140d 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 a1e6d74b4f3261d75dac67025ad21ee5950081a6..26689e5cb0a9f2567e4e6e5d1fe94abe45e1a417 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 8f04b0838fe87db796b0ac65c327c56197e3506d..e8ae2d240290a696a82aa5123baa32bf7638a64d 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 608bca0f03b2a05c0c1b93ba4e0d98186a9e9118..900eb327b3661673ddc07983970add9fb64ec898 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 4d5995c558be93817fd0a83efc40501cfdb8f7b7..5e610d861fe1cf5b139c4723242c983f85288d73 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 54e252a97a5bf159610b76dbc826826899d810d3..9a1f35c947d3be502e8ea2daf9e68c7dd89a384a 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 07b0453fca69fbac95e8256729e5ba9ba6440eb5..aee4358acdf74ad5f0b02a6ee068c155203747f8 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 4a09cf7d33932fae13d77ec29b631a376c1119dd..c7ec022c469307b030ede54321a6a721aa499a2f 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 3d4c37ef52300dcc2b8662e1c54b6a8821feccc8..59fa8b5af0bbc3635c110f3bf9e00b06e8152846 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 58151fa02ce0e5bb465545be53bc8b06f1ae8fe3..08f8a5191c9fcf88d1b9a4e3e21471bcaf5c09e7 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 0d40cc0212ffb811db1e801f2a92a8a7ec6f4b5a..c64b9429cf0a1554a9fb14b9705af6cea8e7a3e1 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 ece0e36402e19344fbb35f1a36458fec19543f38..d8b508ba513740c2236fa5d10c5612cf4bba7945 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 19c2db47768f52d8aa7f888c356591629442c720..b80f4670c368ea74f5194335c4d31277cee5a1ba 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 0ed62abd001a4b4a14e15c0f0e6a48e31bbab4a8..2c8df9625cd7c50d2341307ca1fc25be0b29aafa 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 dc7337c7569c0444d2c4adcda898f955e526ba52..f8b99c48a442d925b82aa90c430100e26e775bd1 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 b97cc17f6a8f47e4bf7a98711c9421b16c19d343..03dd6a54e8f3fbbe08391ee3675d025b0a615108 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 93d992d1d894c15d0bf26635300dd5bb603baf02..29aa0c5380efc9f562ec530650892450bf311173 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 cee871fb17ecaa6a89b28b7df045336a4929d2fe..a1a165e9608a91ac43b3b54ac79b9e388342ba26 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 a726c822cb0be9a7a249ef9333fac2edcd756c1e..8895244158a4735996418a7fc4e4c486a89292a8 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 1b7ae4ebdb7a4d7f685e0cd83c1ef1baa1c14f80..30d7ea2645ec18a8431fcf92ac0bbf5975b2b333 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 65015bd723c6851c4a61d2abe90fd662b43d0203..618190e8e704e72da0a07c12a490e3db0c818d75 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 578cdaed36725646f5ca585c564b74db4fec860d..ae633055b83f4855a9fbc6bafaca578b6502fde0 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 e14d74dd2c09717d7d04167d4c4a0c11244ee635..723478ac34b6e92a4a959d024f474aa1163db2b8 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 1601090463f442140f1724beea1dd2f71a2e113f..25520c9d42a5d5c9d6321b6848b20299926e89bc 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 74dfc42f21088f39818d4b72e35bcf5a5d7fd80c..88fba2f6ccfdcc4ba9d8c6f21823e1a95311076d 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 906b0a2c68b5532d819df116affaa1045931a17d..d5fcfbf31ae91c03fd841653f8d00987b97911d8 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 ab80630cb33a02bc2d7129f7f61b993d15c53ec0..198a154cb9c0db4b8b880a87eecfd32bb9630116 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 bfa529adb344124fcdac0c5bf7ad069f8f6d4419..3bca348429807f274f8637b64b048dcec43af489 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 1261311c767d903943b00a34adb50c309563dbca..f2273bcae10587503b85da36ac17532f5f3bc064 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 5d87bfe8e34f758e7e46b3a8d3e2316a349de5de..8de938af985797752a7e4909ad59779f2fddfaa4 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 5d457f2df7b65ee069c9a28a217811ae42a2df94..9eee857fd832c6ee800814cceaa6eda16fc738f5 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 277f91086639f2e7134e56f97b39fdf7b35221a6..cb22487ba6314defb657af84b53452a02176c298 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 917b927691e07a8aee2b25ecd74156c21f7ca648..ae98a5d85047c0715a6dd82155a797493d105941 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 11ad02975ee8073480b3d219c0b39627f8a2c1d8..04808970af2732fec84562840c21af14dc8736f6 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 94d0f9d597bcb4f46affb2fc6addf488a7ffaba1..91ffba6dd25ac2eb9da0336caa4aad4c929eedab 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 e8bdebe2f58a515b5a0a6645a4fb05e27126435a..16140de67d83a2de748a2aaa05dfe647c4b02998 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 14381b82e62c2f7134098f397ca0b0dac96e9120..ecdb4ec7eec850dbb3ab2a0d9fa069bfa8fe3936 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 df0a095cdd16331dc4c2b38363f7f1d4c1d4f354..d96c6f62dce78798565c197ac6aa4ff9ed3443a3 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 0ca5571515a573bb6c1df393a0a49861d434ffcb..44f83699097e62e7380f3028ee5c502c06ab60b9 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 0ec0eca553afe82434cf1444c7edbc4a7066f747..03609e23dc60b5a1fee6433563990942a638db43 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 0a1a0e50ffcc40d42c8ae6e9eadcf333b71ab9c7..040b4324b053e6d7fcc5ba1ed04b84565915ea2c 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 0b5f366817a4e9e16285a91d886b39149e6309a8..82c98518f48a849abd79c8f967fce11f26922c9a 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 8dd5c507d7da342fde880fdbf2deb8b0ab3a95ee..323267cae6f4466fe4aa8321f422f8f87c0901d5 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 8eb0673aa7325168d23a690859c87e3ac5eb85d9..f731b912d65c6127ea588331a16ed36a53def65b 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 0e06babbd525a287f6e506e0bcd2ea16cf936b6c..7ecced32341d0c118a72f2a4c40b2db36f95b26a 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 e495a14a38cb90e8cb80ca8ecaaa964348a1a8ec..7ea7e24dbb95393c4d3c1520a41794f33313d604 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 4a522b76b8ec561bfe725632d6427ad26ead070e..e2304fc7f6377a097a7d654c3bebae47596e2cc2 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 558a9981171775921308b7b04abb31eeed73f3c8..0594adb1a3c8bafb6c0466a8d7471ab28d5464c7 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 cd2cf5d02c01c621898a80be6603b9ba1c5a8e74..2daa50a22b0d1c580fefac8078397b0195d5f770 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 a85e47c5919369ea7ce1acd32c87931c7b2f3c82..6d85ba94270a57cfce5616d335f7d9a907f3d9f9 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 d498ada704d44ef5ae20a6d204c141df0b05018e..2b1a367215bbfafb97d50d358dad30ac9919afc4 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 da4c7cc8b139184f85bd1636561f96fe57d745ed..a0fe5a6fa314a0557c20f259c05e6a5078276d3d 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 52a3f9f1b1c99afbf5204bd666397e99143af3de..23d4c9ff864d93f007392c26aceb6b649e30957e 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 8f16c216b371062ef8f414af0f20a306e4a65cb0..cdac719d89073e97e5c6e32c6e2540292f4cb91a 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 2ec77e35070c662f827129a4fceef90647c7f2f6..8f237f2fc5a4f27fdc93e01bf8f1cea9e7462fb7 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:<br/>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 28be557c65e4e8b1fe8e460c8c8754598525e6a3..7ee05f0a729c8132ca4ce08c030397a728d331ac 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 d4d60e220c6caba0eccddb1591c787c920620111..2c2add94527af5b89dbe2bca03876177128e6e3f 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 29fca81ca79f3281684bfbd4a5507f5d3075c91a..94795a10c83517bd149ccbf846d7fdfbc397ca8f 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 30b67fac5662d3a5a93620cf7c92a384ddcba94d..d63cdffcca6b66e2438576ba12e4bff01be07db3 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 31e2d6dc495053b3f3ead5478a745aedcc77cbd5..a0f6bc69a0da9c5a1ed7036ab93b124e17e11856 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 44dc6706d57c8d55abbe1bf0210970843037497b..1145f1afa5cb3c58e3368b6c29d47dc2b9492c53 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 6fbf4b8a0f639a1e3ad7c81d3091ef07ee15b29c..1f3ce57333926257c42514537929bebdfa545e3b 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 0aba4a8bd15266a29fe9c15c125df146d89d557d..7388c11f70f20debebb9ac04e5d5e5b991417b70 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 0f622837bfb9c6a558bee9369aa55b580f261fba..fef6857a3844a3305a86b0e1852991deef7af0db 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 f8149782db68a582f2de7c6e3eb542b500b112b2..4e0598fed95c2f568757cfb72945c81a21756188 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 1856aeb9623b6bd66d4df4759b861054f9a33c23..244b4a557e1ee38da8ac386d4002d5dfdf8353ce 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 68442689d3b7b17ce2a822c5c2aff6d2f7eda913..d707546a8cc10922e965f663ac5c13044a2460f4 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 9e0b1514ab5b605016b1d243e94facc4fb973571..60579f43e28eb720babe58f489a3ac1790ee295b 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 6a14c6e1ef7891eed4463f3015d1ae4aeaa2066e..8414bb912c29ad1604e4b060b78327053227fa5e 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 8fdf617e3f6547620508bfa4f0c0bd89977dcfe1..df5e40911ff0363f0afcb873e8c7dc2985ebbe80 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 2c4f02990bf6b7952c7423c0e27d1a4d2c6d620b..80164d34b6922457f598d3762f6c271d3892bb8b 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 dedcc27e44e17821d2772c9bcdf6ef2f95a6b4c8..3395baa3e8662106f95fc491046c0dff868f2844 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 8d713bf494f6fb7eea212b7a719c3e6368eef1df..982446597e585919a40442881021593575eebfc6 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 75a66f61939b5e9e64eef0ef14b5847800b98369..8b83583d1f5ab42fa0aaaf1902099f8f56f70009 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 a44be249f223858aba226b1f90d6a01e446b9e87..b4239dacfabd211c52335642e8b00ef94bc678d4 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 e4d03d03b0a3347dd6d9b3fb7df6d57ead28d73d..61b59ee1b567cf862861c3653c570fbb5f3c988d 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)