diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py
index 9a5744de2fd..3ab1136c7d7 100644
--- a/homeassistant/components/ps4/__init__.py
+++ b/homeassistant/components/ps4/__init__.py
@@ -108,8 +108,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
version = entry.version = 2
config_entries.async_update_entry(entry, data=data)
_LOGGER.info(
- "PlayStation 4 Config Updated: \
- Region changed to: %s",
+ "PlayStation 4 Config Updated: Region changed to: %s",
country,
)
@@ -140,8 +139,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
entry.version = 3
_LOGGER.info(
- "PlayStation 4 identifier for entity: %s \
- has changed",
+ "PlayStation 4 identifier for entity: %s has changed",
entity_id,
)
config_entries.async_update_entry(entry)
diff --git a/homeassistant/components/recorder/pool.py b/homeassistant/components/recorder/pool.py
index 35a8623a1c1..4a0fbddc10b 100644
--- a/homeassistant/components/recorder/pool.py
+++ b/homeassistant/components/recorder/pool.py
@@ -81,9 +81,11 @@ class RecorderPool(SingletonThreadPool, NullPool): # type: ignore[misc]
def _do_get_db_connection_protected(self) -> Any:
report(
- "accesses the database without the database executor; "
- f"{ADVISE_MSG} "
- "for faster database operations",
+ (
+ "accesses the database without the database executor; "
+ f"{ADVISE_MSG} "
+ "for faster database operations"
+ ),
exclude_integrations={"recorder"},
error_if_core=False,
)
diff --git a/homeassistant/components/recorder/statistics.py b/homeassistant/components/recorder/statistics.py
index 0e2676b201f..fab4a67a749 100644
--- a/homeassistant/components/recorder/statistics.py
+++ b/homeassistant/components/recorder/statistics.py
@@ -2434,8 +2434,8 @@ def correct_db_schema(
# Using LOCK=EXCLUSIVE to prevent the database from corrupting
# https://github.com/home-assistant/core/issues/56104
text(
- "ALTER TABLE statistics_meta CONVERT TO "
- "CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, LOCK=EXCLUSIVE"
+ "ALTER TABLE statistics_meta CONVERT TO CHARACTER SET utf8mb4"
+ " COLLATE utf8mb4_unicode_ci, LOCK=EXCLUSIVE"
)
)
diff --git a/homeassistant/components/rflink/__init__.py b/homeassistant/components/rflink/__init__.py
index 6c4159b96be..e703f0d09de 100644
--- a/homeassistant/components/rflink/__init__.py
+++ b/homeassistant/components/rflink/__init__.py
@@ -225,9 +225,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
keepalive_idle_timer = config[DOMAIN][CONF_KEEPALIVE_IDLE]
if keepalive_idle_timer < 0:
_LOGGER.error(
- "A bogus TCP Keepalive IDLE timer was provided (%d secs), "
- "it will be disabled. "
- "Recommended values: 60-3600 (seconds)",
+ (
+ "A bogus TCP Keepalive IDLE timer was provided (%d secs), "
+ "it will be disabled. "
+ "Recommended values: 60-3600 (seconds)"
+ ),
keepalive_idle_timer,
)
keepalive_idle_timer = None
diff --git a/homeassistant/components/samsungtv/__init__.py b/homeassistant/components/samsungtv/__init__.py
index 0a7fd4b3378..5edae371517 100644
--- a/homeassistant/components/samsungtv/__init__.py
+++ b/homeassistant/components/samsungtv/__init__.py
@@ -282,8 +282,10 @@ async def _async_create_bridge_with_updated_data(
if model_requires_encryption(model) and method != METHOD_ENCRYPTED_WEBSOCKET:
LOGGER.info(
- "Detected model %s for %s. Some televisions from H and J series use "
- "an encrypted protocol but you are using %s which may not be supported",
+ (
+ "Detected model %s for %s. Some televisions from H and J series use "
+ "an encrypted protocol but you are using %s which may not be supported"
+ ),
model,
host,
method,
diff --git a/homeassistant/components/samsungtv/bridge.py b/homeassistant/components/samsungtv/bridge.py
index 502c7f2bbb6..20a4765957a 100644
--- a/homeassistant/components/samsungtv/bridge.py
+++ b/homeassistant/components/samsungtv/bridge.py
@@ -503,9 +503,11 @@ class SamsungTVWSBridge(
return RESULT_SUCCESS
except ConnectionClosedError as err:
LOGGER.info(
- "Working but unsupported config: %s, error: '%s'; this may "
- "be an indication that access to the TV has been denied. Please "
- "check the Device Connection Manager on your TV",
+ (
+ "Working but unsupported config: %s, error: '%s'; this may be"
+ " an indication that access to the TV has been denied. Please"
+ " check the Device Connection Manager on your TV"
+ ),
config,
err,
)
@@ -590,8 +592,10 @@ class SamsungTVWSBridge(
self._remote = None
except ConnectionFailure as err:
LOGGER.warning(
- "Unexpected ConnectionFailure trying to get remote for %s, "
- "please report this issue: %s",
+ (
+ "Unexpected ConnectionFailure trying to get remote for %s, "
+ "please report this issue: %s"
+ ),
self.host,
repr(err),
)
@@ -633,8 +637,10 @@ class SamsungTVWSBridge(
message := data.get("message")
) == "unrecognized method value : ms.remote.control":
LOGGER.error(
- "Your TV seems to be unsupported by SamsungTVWSBridge"
- " and needs a PIN: '%s'. Updating config entry",
+ (
+ "Your TV seems to be unsupported by SamsungTVWSBridge"
+ " and needs a PIN: '%s'. Updating config entry"
+ ),
message,
)
self._notify_update_config_entry(
@@ -780,7 +786,10 @@ class SamsungTVEncryptedBridge(
else:
if self._model and not self._power_off_warning_logged:
LOGGER.warning(
- "Unknown power_off command for %s (%s): sending KEY_POWEROFF and KEY_POWER",
+ (
+ "Unknown power_off command for %s (%s): sending KEY_POWEROFF"
+ " and KEY_POWER"
+ ),
self._model,
self.host,
)
diff --git a/homeassistant/components/schedule/__init__.py b/homeassistant/components/schedule/__init__.py
index fefb5189e3c..d7c61798587 100644
--- a/homeassistant/components/schedule/__init__.py
+++ b/homeassistant/components/schedule/__init__.py
@@ -69,7 +69,8 @@ def valid_schedule(schedule: list[dict[str, str]]) -> list[dict[str, str]]:
for time_range in schedule:
if time_range[CONF_FROM] >= time_range[CONF_TO]:
raise vol.Invalid(
- f"Invalid time range, from {time_range[CONF_FROM]} is after {time_range[CONF_TO]}"
+ f"Invalid time range, from {time_range[CONF_FROM]} is after"
+ f" {time_range[CONF_TO]}"
)
# Check if the from time of the event is after the to time of the previous event
diff --git a/homeassistant/components/screenlogic/climate.py b/homeassistant/components/screenlogic/climate.py
index 5b7a4f591b3..588d6d9a581 100644
--- a/homeassistant/components/screenlogic/climate.py
+++ b/homeassistant/components/screenlogic/climate.py
@@ -142,7 +142,8 @@ class ScreenLogicClimate(ScreenlogicEntity, ClimateEntity, RestoreEntity):
await self._async_refresh()
else:
raise HomeAssistantError(
- f"Failed to set_temperature {temperature} on body {self.body['body_type']['value']}"
+ f"Failed to set_temperature {temperature} on body"
+ f" {self.body['body_type']['value']}"
)
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
@@ -156,7 +157,8 @@ class ScreenLogicClimate(ScreenlogicEntity, ClimateEntity, RestoreEntity):
await self._async_refresh()
else:
raise HomeAssistantError(
- f"Failed to set_hvac_mode {mode} on body {self.body['body_type']['value']}"
+ f"Failed to set_hvac_mode {mode} on body"
+ f" {self.body['body_type']['value']}"
)
async def async_set_preset_mode(self, preset_mode: str) -> None:
@@ -170,7 +172,8 @@ class ScreenLogicClimate(ScreenlogicEntity, ClimateEntity, RestoreEntity):
await self._async_refresh()
else:
raise HomeAssistantError(
- f"Failed to set_preset_mode {mode} on body {self.body['body_type']['value']}"
+ f"Failed to set_preset_mode {mode} on body"
+ f" {self.body['body_type']['value']}"
)
async def async_added_to_hass(self) -> None:
diff --git a/homeassistant/components/screenlogic/config_flow.py b/homeassistant/components/screenlogic/config_flow.py
index 2b845d453df..77040bdb216 100644
--- a/homeassistant/components/screenlogic/config_flow.py
+++ b/homeassistant/components/screenlogic/config_flow.py
@@ -129,7 +129,9 @@ class ScreenlogicConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
vol.Required(GATEWAY_SELECT_KEY): vol.In(
{
**unconfigured_gateways,
- GATEWAY_MANUAL_ENTRY: "Manually configure a ScreenLogic gateway",
+ GATEWAY_MANUAL_ENTRY: (
+ "Manually configure a ScreenLogic gateway"
+ ),
}
)
}
diff --git a/homeassistant/components/screenlogic/services.py b/homeassistant/components/screenlogic/services.py
index 09f76c0e09e..17c52932e09 100644
--- a/homeassistant/components/screenlogic/services.py
+++ b/homeassistant/components/screenlogic/services.py
@@ -48,7 +48,8 @@ def async_load_screenlogic_services(hass: HomeAssistant):
)
):
raise HomeAssistantError(
- f"Failed to call service '{SERVICE_SET_COLOR_MODE}'. Config entry for target not found"
+ f"Failed to call service '{SERVICE_SET_COLOR_MODE}'. Config entry for"
+ " target not found"
)
color_num = SUPPORTED_COLOR_MODES[service_call.data[ATTR_COLOR_MODE]]
for entry_id in screenlogic_entry_ids:
diff --git a/homeassistant/components/sensibo/select.py b/homeassistant/components/sensibo/select.py
index afb961b429a..b69de8d0763 100644
--- a/homeassistant/components/sensibo/select.py
+++ b/homeassistant/components/sensibo/select.py
@@ -104,7 +104,8 @@ class SensiboSelect(SensiboDeviceBaseEntity, SelectEntity):
"""Set state to the selected option."""
if self.entity_description.key not in self.device_data.active_features:
raise HomeAssistantError(
- f"Current mode {self.device_data.hvac_mode} doesn't support setting {self.entity_description.name}"
+ f"Current mode {self.device_data.hvac_mode} doesn't support setting"
+ f" {self.entity_description.name}"
)
await self.async_send_api_call(
diff --git a/homeassistant/components/sensibo/switch.py b/homeassistant/components/sensibo/switch.py
index f57d72e5fb3..8d0dc5fba2f 100644
--- a/homeassistant/components/sensibo/switch.py
+++ b/homeassistant/components/sensibo/switch.py
@@ -184,7 +184,8 @@ class SensiboDeviceSwitch(SensiboDeviceBaseEntity, SwitchEntity):
"""Make service call to api for setting Climate React."""
if self.device_data.smart_type is None:
raise HomeAssistantError(
- "Use Sensibo Enable Climate React Service once to enable switch or the Sensibo app"
+ "Use Sensibo Enable Climate React Service once to enable switch or the"
+ " Sensibo app"
)
new_state = bool(self.device_data.smart_on is False)
data: dict[str, Any] = {"enabled": new_state}
diff --git a/homeassistant/components/sensor/__init__.py b/homeassistant/components/sensor/__init__.py
index f6cf9ec2c9e..fc6f0b60815 100644
--- a/homeassistant/components/sensor/__init__.py
+++ b/homeassistant/components/sensor/__init__.py
@@ -756,11 +756,12 @@ class SensorEntity(Entity):
report_issue = self._suggest_report_issue()
# This should raise in Home Assistant Core 2022.5
_LOGGER.warning(
- "Entity %s (%s) with state_class %s has set last_reset. Setting "
- "last_reset for entities with state_class other than 'total' is "
- "not supported. "
- "Please update your configuration if state_class is manually "
- "configured, otherwise %s",
+ (
+ "Entity %s (%s) with state_class %s has set last_reset. Setting"
+ " last_reset for entities with state_class other than 'total'"
+ " is not supported. Please update your configuration if"
+ " state_class is manually configured, otherwise %s"
+ ),
self.entity_id,
type(self),
self.state_class,
@@ -968,10 +969,12 @@ class SensorEntity(Entity):
# This should raise in Home Assistant Core 2023.6
_LOGGER.warning(
- "Entity %s (%s) is using native unit of measurement '%s' which "
- "is not a valid unit for the device class ('%s') it is using; "
- "Please update your configuration if your entity is manually "
- "configured, otherwise %s",
+ (
+ "Entity %s (%s) is using native unit of measurement '%s' which "
+ "is not a valid unit for the device class ('%s') it is using; "
+ "Please update your configuration if your entity is manually "
+ "configured, otherwise %s"
+ ),
self.entity_id,
type(self),
native_unit_of_measurement,
diff --git a/homeassistant/components/sensor/recorder.py b/homeassistant/components/sensor/recorder.py
index e35a7254d5a..412ea3d4d5d 100644
--- a/homeassistant/components/sensor/recorder.py
+++ b/homeassistant/components/sensor/recorder.py
@@ -202,9 +202,11 @@ def _normalize_states(
f"({old_metadata['unit_of_measurement']})"
)
_LOGGER.warning(
- "The unit of %s is changing, got multiple %s, generation of long term "
- "statistics will be suppressed unless the unit is stable%s. "
- "Go to %s to fix this",
+ (
+ "The unit of %s is changing, got multiple %s, generation of"
+ " long term statistics will be suppressed unless the unit is"
+ " stable%s. Go to %s to fix this"
+ ),
entity_id,
all_units,
extra,
@@ -226,11 +228,12 @@ def _normalize_states(
if entity_id not in hass.data[WARN_UNSUPPORTED_UNIT]:
hass.data[WARN_UNSUPPORTED_UNIT].add(entity_id)
_LOGGER.warning(
- "The unit of %s (%s) can not be converted to the unit of previously "
- "compiled statistics (%s). Generation of long term statistics "
- "will be suppressed unless the unit changes back to %s or a "
- "compatible unit. "
- "Go to %s to fix this",
+ (
+ "The unit of %s (%s) can not be converted to the unit of"
+ " previously compiled statistics (%s). Generation of long term"
+ " statistics will be suppressed unless the unit changes back to"
+ " %s or a compatible unit. Go to %s to fix this"
+ ),
entity_id,
state_unit,
statistics_unit,
@@ -291,9 +294,11 @@ def warn_dip(
if domain in ["energy", "growatt_server", "solaredge"]:
return
_LOGGER.warning(
- "Entity %s %shas state class total_increasing, but its state is "
- "not strictly increasing. Triggered by state %s (%s) with last_updated set to %s. "
- "Please %s",
+ (
+ "Entity %s %shas state class total_increasing, but its state is not"
+ " strictly increasing. Triggered by state %s (%s) with last_updated set"
+ " to %s. Please %s"
+ ),
entity_id,
f"from integration {domain} " if domain else "",
state.state,
@@ -311,8 +316,10 @@ def warn_negative(hass: HomeAssistant, entity_id: str, state: State) -> None:
hass.data[WARN_NEGATIVE].add(entity_id)
domain = entity_sources(hass).get(entity_id, {}).get("domain")
_LOGGER.warning(
- "Entity %s %shas state class total_increasing, but its state is "
- "negative. Triggered by state %s with last_updated set to %s. Please %s",
+ (
+ "Entity %s %shas state class total_increasing, but its state is "
+ "negative. Triggered by state %s with last_updated set to %s. Please %s"
+ ),
entity_id,
f"from integration {domain} " if domain else "",
state.state,
@@ -472,11 +479,13 @@ def _compile_statistics( # noqa: C901
if entity_id not in hass.data[WARN_UNSTABLE_UNIT]:
hass.data[WARN_UNSTABLE_UNIT].add(entity_id)
_LOGGER.warning(
- "The unit of %s (%s) can not be converted to the unit of previously "
- "compiled statistics (%s). Generation of long term statistics "
- "will be suppressed unless the unit changes back to %s or a "
- "compatible unit. "
- "Go to %s to fix this",
+ (
+ "The unit of %s (%s) can not be converted to the unit of"
+ " previously compiled statistics (%s). Generation of long"
+ " term statistics will be suppressed unless the unit"
+ " changes back to %s or a compatible unit. Go to %s to fix"
+ " this"
+ ),
entity_id,
statistics_unit,
old_metadata[1]["unit_of_measurement"],
@@ -531,13 +540,19 @@ def _compile_statistics( # noqa: C901
):
if old_state is None:
_LOGGER.info(
- "Compiling initial sum statistics for %s, zero point set to %s",
+ (
+ "Compiling initial sum statistics for %s, zero point"
+ " set to %s"
+ ),
entity_id,
fstate,
)
else:
_LOGGER.info(
- "Detected new cycle for %s, last_reset set to %s (old last_reset %s)",
+ (
+ "Detected new cycle for %s, last_reset set to %s (old"
+ " last_reset %s)"
+ ),
entity_id,
last_reset,
old_last_reset,
@@ -557,8 +572,11 @@ def _compile_statistics( # noqa: C901
):
reset = True
_LOGGER.info(
- "Detected new cycle for %s, value dropped from %s to %s, "
- "triggered by state with last_updated set to %s",
+ (
+ "Detected new cycle for %s, value dropped from %s"
+ " to %s, triggered by state with last_updated set"
+ " to %s"
+ ),
entity_id,
new_state,
state.last_updated.isoformat(),
diff --git a/homeassistant/components/shelly/__init__.py b/homeassistant/components/shelly/__init__.py
index 7ccad2bffc1..df054598f5c 100644
--- a/homeassistant/components/shelly/__init__.py
+++ b/homeassistant/components/shelly/__init__.py
@@ -98,7 +98,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# value, so if host isn't present, config entry will not be configured.
if not entry.data.get(CONF_HOST):
LOGGER.warning(
- "The config entry %s probably comes from a custom integration, please remove it if you want to use core Shelly integration",
+ (
+ "The config entry %s probably comes from a custom integration, please"
+ " remove it if you want to use core Shelly integration"
+ ),
entry.title,
)
return False
diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py
index a624ba341af..b9435a56ebd 100644
--- a/homeassistant/components/shelly/climate.py
+++ b/homeassistant/components/shelly/climate.py
@@ -265,7 +265,8 @@ class BlockSleepingClimate(
except DeviceConnectionError as err:
self.coordinator.last_update_success = False
raise HomeAssistantError(
- f"Setting state for entity {self.name} failed, state: {kwargs}, error: {repr(err)}"
+ f"Setting state for entity {self.name} failed, state: {kwargs}, error:"
+ f" {repr(err)}"
) from err
except InvalidAuthError:
self.coordinator.entry.async_start_reauth(self.hass)
diff --git a/homeassistant/components/shelly/entity.py b/homeassistant/components/shelly/entity.py
index ad4c72a64a0..2ab0af8f18e 100644
--- a/homeassistant/components/shelly/entity.py
+++ b/homeassistant/components/shelly/entity.py
@@ -347,7 +347,8 @@ class ShellyBlockEntity(CoordinatorEntity[ShellyBlockCoordinator]):
except DeviceConnectionError as err:
self.coordinator.last_update_success = False
raise HomeAssistantError(
- f"Setting state for entity {self.name} failed, state: {kwargs}, error: {repr(err)}"
+ f"Setting state for entity {self.name} failed, state: {kwargs}, error:"
+ f" {repr(err)}"
) from err
except InvalidAuthError:
self.coordinator.entry.async_start_reauth(self.hass)
@@ -399,11 +400,13 @@ class ShellyRpcEntity(CoordinatorEntity[ShellyRpcCoordinator]):
except DeviceConnectionError as err:
self.coordinator.last_update_success = False
raise HomeAssistantError(
- f"Call RPC for {self.name} connection error, method: {method}, params: {params}, error: {repr(err)}"
+ f"Call RPC for {self.name} connection error, method: {method}, params:"
+ f" {params}, error: {repr(err)}"
) from err
except RpcCallError as err:
raise HomeAssistantError(
- f"Call RPC for {self.name} request error, method: {method}, params: {params}, error: {repr(err)}"
+ f"Call RPC for {self.name} request error, method: {method}, params:"
+ f" {params}, error: {repr(err)}"
) from err
except InvalidAuthError:
self.coordinator.entry.async_start_reauth(self.hass)
diff --git a/homeassistant/components/shelly/logbook.py b/homeassistant/components/shelly/logbook.py
index 38465112345..6099bffd596 100644
--- a/homeassistant/components/shelly/logbook.py
+++ b/homeassistant/components/shelly/logbook.py
@@ -53,7 +53,9 @@ def async_describe_events(
return {
LOGBOOK_ENTRY_NAME: "Shelly",
- LOGBOOK_ENTRY_MESSAGE: f"'{click_type}' click event for {input_name} Input was fired",
+ LOGBOOK_ENTRY_MESSAGE: (
+ f"'{click_type}' click event for {input_name} Input was fired"
+ ),
}
async_describe_event(DOMAIN, EVENT_SHELLY_CLICK, async_describe_shelly_click_event)
diff --git a/homeassistant/components/shelly/number.py b/homeassistant/components/shelly/number.py
index 7066f386355..d13c891e13a 100644
--- a/homeassistant/components/shelly/number.py
+++ b/homeassistant/components/shelly/number.py
@@ -117,7 +117,8 @@ class BlockSleepingNumber(ShellySleepingBlockAttributeEntity, NumberEntity):
except DeviceConnectionError as err:
self.coordinator.last_update_success = False
raise HomeAssistantError(
- f"Setting state for entity {self.name} failed, state: {params}, error: {repr(err)}"
+ f"Setting state for entity {self.name} failed, state: {params}, error:"
+ f" {repr(err)}"
) from err
except InvalidAuthError:
self.coordinator.entry.async_start_reauth(self.hass)
diff --git a/homeassistant/components/shopping_list/__init__.py b/homeassistant/components/shopping_list/__init__.py
index 2b0ff0e7674..3c478a3c83a 100644
--- a/homeassistant/components/shopping_list/__init__.py
+++ b/homeassistant/components/shopping_list/__init__.py
@@ -264,7 +264,8 @@ class ShoppingData:
# so all items left in the mapping should be checked items.
if all_items_mapping[key]["complete"] is False:
raise vol.Invalid(
- "The item ids array doesn't contain all the unchecked shopping list items."
+ "The item ids array doesn't contain all the unchecked shopping list"
+ " items."
)
new_items.append(all_items_mapping[key])
self.items = new_items
diff --git a/homeassistant/components/signal_messenger/notify.py b/homeassistant/components/signal_messenger/notify.py
index 7f48d83ba19..25dae1617c3 100644
--- a/homeassistant/components/signal_messenger/notify.py
+++ b/homeassistant/components/signal_messenger/notify.py
@@ -151,7 +151,8 @@ class SignalNotificationService(BaseNotificationService):
> attachment_size_limit
):
raise ValueError(
- "Attachment too large (Content-Length reports {}). Max size: {} bytes".format(
+ "Attachment too large (Content-Length reports {}). Max size: {}"
+ " bytes".format(
int(str(resp.headers.get("Content-Length"))),
CONF_MAX_ALLOWED_DOWNLOAD_SIZE_BYTES,
)
@@ -163,9 +164,8 @@ class SignalNotificationService(BaseNotificationService):
size += len(chunk)
if size > attachment_size_limit:
raise ValueError(
- "Attachment too large (Stream reports {}). Max size: {} bytes".format(
- size, CONF_MAX_ALLOWED_DOWNLOAD_SIZE_BYTES
- )
+ "Attachment too large (Stream reports {}). Max size: {}"
+ " bytes".format(size, CONF_MAX_ALLOWED_DOWNLOAD_SIZE_BYTES)
)
chunks.extend(chunk)
diff --git a/homeassistant/components/sleepiq/number.py b/homeassistant/components/sleepiq/number.py
index 01ba90360ba..1f8ef80a1f1 100644
--- a/homeassistant/components/sleepiq/number.py
+++ b/homeassistant/components/sleepiq/number.py
@@ -47,7 +47,10 @@ async def _async_set_actuator_position(
def _get_actuator_name(bed: SleepIQBed, actuator: SleepIQActuator) -> str:
if actuator.side:
- return f"SleepNumber {bed.name} {actuator.side_full} {actuator.actuator_full} {ENTITY_TYPES[ACTUATOR]}"
+ return (
+ "SleepNumber"
+ f" {bed.name} {actuator.side_full} {actuator.actuator_full} {ENTITY_TYPES[ACTUATOR]}"
+ )
return f"SleepNumber {bed.name} {actuator.actuator_full} {ENTITY_TYPES[ACTUATOR]}"
diff --git a/homeassistant/components/smartthings/__init__.py b/homeassistant/components/smartthings/__init__.py
index f5b462e9642..60cc2cea0d4 100644
--- a/homeassistant/components/smartthings/__init__.py
+++ b/homeassistant/components/smartthings/__init__.py
@@ -92,7 +92,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if not validate_webhook_requirements(hass):
_LOGGER.warning(
- "The 'base_url' of the 'http' integration must be configured and start with 'https://'"
+ "The 'base_url' of the 'http' integration must be configured and start with"
+ " 'https://'"
)
return False
@@ -135,7 +136,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await device.status.refresh()
except ClientResponseError:
_LOGGER.debug(
- "Unable to update status for device: %s (%s), the device will be excluded",
+ (
+ "Unable to update status for device: %s (%s), the device will"
+ " be excluded"
+ ),
device.label,
device.device_id,
exc_info=True,
@@ -161,7 +165,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except ClientResponseError as ex:
if ex.status in (HTTPStatus.UNAUTHORIZED, HTTPStatus.FORBIDDEN):
_LOGGER.exception(
- "Unable to setup configuration entry '%s' - please reconfigure the integration",
+ (
+ "Unable to setup configuration entry '%s' - please reconfigure the"
+ " integration"
+ ),
entry.title,
)
remove_entry = True
@@ -194,7 +201,10 @@ async def async_get_entry_scenes(entry: ConfigEntry, api):
except ClientResponseError as ex:
if ex.status == HTTPStatus.FORBIDDEN:
_LOGGER.exception(
- "Unable to load scenes for configuration entry '%s' because the access token does not have the required access",
+ (
+ "Unable to load scenes for configuration entry '%s' because the"
+ " access token does not have the required access"
+ ),
entry.title,
)
else:
@@ -237,7 +247,10 @@ async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
app_count = sum(1 for entry in all_entries if entry.data[CONF_APP_ID] == app_id)
if app_count > 1:
_LOGGER.debug(
- "App %s was not removed because it is in use by other configuration entries",
+ (
+ "App %s was not removed because it is in use by other configuration"
+ " entries"
+ ),
app_id,
)
return
diff --git a/homeassistant/components/smartthings/climate.py b/homeassistant/components/smartthings/climate.py
index e49ecd7abf9..f311fb2a44d 100644
--- a/homeassistant/components/smartthings/climate.py
+++ b/homeassistant/components/smartthings/climate.py
@@ -236,7 +236,10 @@ class SmartThingsThermostat(SmartThingsEntity, ClimateEntity):
modes.add(state)
else:
_LOGGER.debug(
- "Device %s (%s) returned an invalid supported thermostat mode: %s",
+ (
+ "Device %s (%s) returned an invalid supported thermostat"
+ " mode: %s"
+ ),
self._device.label,
self._device.device_id,
mode,
diff --git a/homeassistant/components/smartthings/config_flow.py b/homeassistant/components/smartthings/config_flow.py
index 9a11fe43e02..336eb99f6ee 100644
--- a/homeassistant/components/smartthings/config_flow.py
+++ b/homeassistant/components/smartthings/config_flow.py
@@ -66,7 +66,9 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
reason="invalid_webhook_url",
description_placeholders={
"webhook_url": webhook_url,
- "component_url": "https://www.home-assistant.io/integrations/smartthings/",
+ "component_url": (
+ "https://www.home-assistant.io/integrations/smartthings/"
+ ),
},
)
@@ -216,7 +218,9 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
errors=errors,
description_placeholders={
"token_url": "https://account.smartthings.com/tokens",
- "component_url": "https://www.home-assistant.io/integrations/smartthings/",
+ "component_url": (
+ "https://www.home-assistant.io/integrations/smartthings/"
+ ),
},
)
diff --git a/homeassistant/components/smartthings/smartapp.py b/homeassistant/components/smartthings/smartapp.py
index adf0426e9a2..b6bd05740e6 100644
--- a/homeassistant/components/smartthings/smartapp.py
+++ b/homeassistant/components/smartthings/smartapp.py
@@ -338,7 +338,10 @@ async def smartapp_sync_subscriptions(
try:
await api.delete_subscription(installed_app_id, sub.subscription_id)
_LOGGER.debug(
- "Removed subscription for '%s' under app '%s' because it was no longer needed",
+ (
+ "Removed subscription for '%s' under app '%s' because it was no"
+ " longer needed"
+ ),
sub.capability,
installed_app_id,
)
@@ -361,9 +364,11 @@ async def smartapp_sync_subscriptions(
capability_count = len(capabilities)
if capability_count > SUBSCRIPTION_WARNING_LIMIT:
_LOGGER.warning(
- "Some device attributes may not receive push updates and there may be subscription "
- "creation failures under app '%s' because %s subscriptions are required but "
- "there is a limit of %s per app",
+ (
+ "Some device attributes may not receive push updates and there may be"
+ " subscription creation failures under app '%s' because %s"
+ " subscriptions are required but there is a limit of %s per app"
+ ),
installed_app_id,
capability_count,
SUBSCRIPTION_WARNING_LIMIT,
diff --git a/homeassistant/components/smtp/notify.py b/homeassistant/components/smtp/notify.py
index 866d7980d08..300e74a2cd6 100644
--- a/homeassistant/components/smtp/notify.py
+++ b/homeassistant/components/smtp/notify.py
@@ -154,16 +154,17 @@ class MailNotificationService(BaseNotificationService):
server = self.connect()
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",
+ (
+ "SMTP server not found or refused connection (%s:%s). Please check"
+ " the IP address, hostname, and availability of your SMTP server"
+ ),
self._server,
self._port,
)
except smtplib.SMTPAuthenticationError:
_LOGGER.exception(
- "Login not possible. "
- "Please check your setting and/or your credentials"
+ "Login not possible. Please check your setting and/or your credentials"
)
return False
diff --git a/homeassistant/components/snooz/fan.py b/homeassistant/components/snooz/fan.py
index 8ad2372924b..d8c8f54d7bb 100644
--- a/homeassistant/components/snooz/fan.py
+++ b/homeassistant/components/snooz/fan.py
@@ -115,5 +115,6 @@ class SnoozFan(FanEntity, RestoreEntity):
self._async_write_state_changed()
elif result.status != SnoozCommandResultStatus.CANCELLED:
raise HomeAssistantError(
- f"Command {command} failed with status {result.status.name} after {result.duration}"
+ f"Command {command} failed with status {result.status.name} after"
+ f" {result.duration}"
)
diff --git a/homeassistant/components/solaredge/coordinator.py b/homeassistant/components/solaredge/coordinator.py
index 9d87a992cc0..839f2cf37eb 100644
--- a/homeassistant/components/solaredge/coordinator.py
+++ b/homeassistant/components/solaredge/coordinator.py
@@ -262,7 +262,8 @@ class SolarEdgePowerFlowDataService(SolarEdgeDataService):
if "connections" not in power_flow:
LOGGER.debug(
- "Missing connections in power flow data. Assuming site does not have any"
+ "Missing connections in power flow data. Assuming site does not"
+ " have any"
)
return
diff --git a/homeassistant/components/solarlog/__init__.py b/homeassistant/components/solarlog/__init__.py
index 22c0e3d87d7..d35da5b8a90 100644
--- a/homeassistant/components/solarlog/__init__.py
+++ b/homeassistant/components/solarlog/__init__.py
@@ -64,7 +64,10 @@ class SolarlogData(update_coordinator.DataUpdateCoordinator):
)
self.logger.debug(
- "Connection to Solarlog successful. Retrieving latest Solarlog update of %s",
+ (
+ "Connection to Solarlog successful. Retrieving latest Solarlog update"
+ " of %s"
+ ),
data.time,
)
diff --git a/homeassistant/components/soma/__init__.py b/homeassistant/components/soma/__init__.py
index 1b3478b2897..7172704c796 100644
--- a/homeassistant/components/soma/__init__.py
+++ b/homeassistant/components/soma/__init__.py
@@ -88,7 +88,10 @@ def soma_api_call(api_call):
if self.is_available:
self.is_available = False
_LOGGER.warning(
- "Device is unreachable (%s). Error while fetching the state: %s",
+ (
+ "Device is unreachable (%s). Error while fetching the"
+ " state: %s"
+ ),
self.name,
response_from_api["msg"],
)
diff --git a/homeassistant/components/soma/cover.py b/homeassistant/components/soma/cover.py
index 116f88aa20e..ecb004083df 100644
--- a/homeassistant/components/soma/cover.py
+++ b/homeassistant/components/soma/cover.py
@@ -98,7 +98,8 @@ class SomaTilt(SomaEntity, CoverEntity):
response = self.api.set_shade_position(self.device["mac"], target_api_position)
if not is_api_response_success(response):
raise HomeAssistantError(
- f'Error while setting the cover position ({self.name}): {response["msg"]}'
+ f"Error while setting the cover position ({self.name}):"
+ f' {response["msg"]}'
)
self.set_position(kwargs[ATTR_TILT_POSITION])
@@ -169,7 +170,8 @@ class SomaShade(SomaEntity, CoverEntity):
)
if not is_api_response_success(response):
raise HomeAssistantError(
- f'Error while setting the cover position ({self.name}): {response["msg"]}'
+ f"Error while setting the cover position ({self.name}):"
+ f' {response["msg"]}'
)
async def async_update(self) -> None:
diff --git a/homeassistant/components/sonarr/sensor.py b/homeassistant/components/sonarr/sensor.py
index e2e9e3caf71..1c4b9afb08d 100644
--- a/homeassistant/components/sonarr/sensor.py
+++ b/homeassistant/components/sonarr/sensor.py
@@ -122,7 +122,9 @@ SENSOR_TYPES: dict[str, SonarrSensorEntityDescription[Any]] = {
entity_registry_enabled_default=False,
value_fn=len,
attributes_fn=lambda data: {
- i.title: f"{getattr(i.statistics,'episodeFileCount', 0)}/{getattr(i.statistics, 'episodeCount', 0)} Episodes"
+ i.title: (
+ f"{getattr(i.statistics,'episodeFileCount', 0)}/{getattr(i.statistics, 'episodeCount', 0)} Episodes"
+ )
for i in data
},
),
diff --git a/homeassistant/components/songpal/media_player.py b/homeassistant/components/songpal/media_player.py
index 56b5c2d60b0..6b7cf73b28b 100644
--- a/homeassistant/components/songpal/media_player.py
+++ b/homeassistant/components/songpal/media_player.py
@@ -52,7 +52,8 @@ 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"
)
diff --git a/homeassistant/components/sonos/__init__.py b/homeassistant/components/sonos/__init__.py
index f0dd8e668fa..2f003e4bde9 100644
--- a/homeassistant/components/sonos/__init__.py
+++ b/homeassistant/components/sonos/__init__.py
@@ -136,7 +136,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if deprecated_address := config.get(CONF_INTERFACE_ADDR):
_LOGGER.warning(
- "'%s' is deprecated, enable %s in the Network integration (https://www.home-assistant.io/integrations/network/)",
+ (
+ "'%s' is deprecated, enable %s in the Network integration"
+ " (https://www.home-assistant.io/integrations/network/)"
+ ),
CONF_INTERFACE_ADDR,
deprecated_address,
)
@@ -365,7 +368,8 @@ class SonosDiscoveryManager:
"""Handle discovery via ssdp or zeroconf."""
if self._manual_config_required:
_LOGGER.warning(
- "Automatic discovery is working, Sonos hosts in configuration.yaml are not needed"
+ "Automatic discovery is working, Sonos hosts in configuration.yaml are"
+ " not needed"
)
self._manual_config_required = False
if model in DISCOVERY_IGNORED_MODELS:
diff --git a/homeassistant/components/sonos/entity.py b/homeassistant/components/sonos/entity.py
index 0955fb0e82d..ac7b96ec965 100644
--- a/homeassistant/components/sonos/entity.py
+++ b/homeassistant/components/sonos/entity.py
@@ -58,12 +58,21 @@ class SonosEntity(Entity):
"""Poll the entity if subscriptions fail."""
if not self.speaker.subscriptions_failed:
if soco_config.EVENT_ADVERTISE_IP:
- listener_msg = f"{self.speaker.subscription_address} (advertising as {soco_config.EVENT_ADVERTISE_IP})"
+ listener_msg = (
+ f"{self.speaker.subscription_address}"
+ f" (advertising as {soco_config.EVENT_ADVERTISE_IP})"
+ )
else:
listener_msg = self.speaker.subscription_address
- message = f"{self.speaker.zone_name} cannot reach {listener_msg}, falling back to polling, functionality may be limited"
+ message = (
+ f"{self.speaker.zone_name} cannot reach {listener_msg},"
+ " falling back to polling, functionality may be limited"
+ )
log_link_msg = f", see {SUB_FAIL_URL} for more details"
- notification_link_msg = f'.\n\nSee Sonos documentation for more details.'
+ notification_link_msg = (
+ f'.\n\nSee Sonos documentation'
+ " for more details."
+ )
_LOGGER.warning(message + log_link_msg)
persistent_notification.async_create(
self.hass,
diff --git a/homeassistant/components/sonos/speaker.py b/homeassistant/components/sonos/speaker.py
index 38d37e7cfd4..5460230b66f 100644
--- a/homeassistant/components/sonos/speaker.py
+++ b/homeassistant/components/sonos/speaker.py
@@ -657,7 +657,10 @@ class SonosSpeaker:
return
if "BattChg" not in battery_dict:
_LOGGER.debug(
- "Unknown device properties update for %s (%s), please report an issue: '%s'",
+ (
+ "Unknown device properties update for %s (%s),"
+ " please report an issue: '%s'"
+ ),
self.zone_name,
self.model_name,
more_info,
@@ -1047,7 +1050,8 @@ class SonosSpeaker:
speakers_set = {s for s in speakers if s.soco_snapshot}
if missing_snapshots := set(speakers) - speakers_set:
raise HomeAssistantError(
- f"Restore failed, speakers are missing snapshots: {[s.zone_name for s in missing_snapshots]}"
+ "Restore failed, speakers are missing snapshots:"
+ f" {[s.zone_name for s in missing_snapshots]}"
)
if with_group:
diff --git a/homeassistant/components/sonos/switch.py b/homeassistant/components/sonos/switch.py
index bbeda6edb63..537f25830b3 100644
--- a/homeassistant/components/sonos/switch.py
+++ b/homeassistant/components/sonos/switch.py
@@ -255,7 +255,10 @@ class SonosAlarmEntity(SonosEntity, SwitchEntity):
@property
def name(self) -> str:
"""Return the name of the sensor."""
- return f"{self.alarm.recurrence.capitalize()} alarm {str(self.alarm.start_time)[:5]}"
+ return (
+ f"{self.alarm.recurrence.capitalize()} alarm"
+ f" {str(self.alarm.start_time)[:5]}"
+ )
async def _async_fallback_poll(self) -> None:
"""Call the central alarm polling method."""
@@ -424,7 +427,10 @@ def async_migrate_speech_enhancement_entity_unique_id(
if len(speech_enhancement_entries) > 1:
_LOGGER.warning(
- "Migration of Speech Enhancement switches on %s failed, manual cleanup required: %s",
+ (
+ "Migration of Speech Enhancement switches on %s failed,"
+ " manual cleanup required: %s"
+ ),
speaker.zone_name,
[e.entity_id for e in speech_enhancement_entries],
)
diff --git a/homeassistant/components/spotify/media_player.py b/homeassistant/components/spotify/media_player.py
index 00354e84b92..d09b2795e88 100644
--- a/homeassistant/components/spotify/media_player.py
+++ b/homeassistant/components/spotify/media_player.py
@@ -378,7 +378,8 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
if not self._scope_ok:
_LOGGER.debug(
- "Spotify scopes are not set correctly, this can impact features such as media browsing"
+ "Spotify scopes are not set correctly, this can impact features such as"
+ " media browsing"
)
raise NotImplementedError
diff --git a/homeassistant/components/squeezebox/media_player.py b/homeassistant/components/squeezebox/media_player.py
index 394f57d1c2d..6a171ffe30f 100644
--- a/homeassistant/components/squeezebox/media_player.py
+++ b/homeassistant/components/squeezebox/media_player.py
@@ -590,7 +590,8 @@ class SqueezeBoxEntity(MediaPlayerEntity):
async def async_sync(self, other_player):
"""Sync this Squeezebox player to another. Deprecated."""
_LOGGER.warning(
- "Service squeezebox.sync is deprecated; use media_player.join_players instead"
+ "Service squeezebox.sync is deprecated; use media_player.join_players"
+ " instead"
)
await self.async_join_players([other_player])
@@ -601,7 +602,8 @@ class SqueezeBoxEntity(MediaPlayerEntity):
async def async_unsync(self):
"""Unsync this Squeezebox player. Deprecated."""
_LOGGER.warning(
- "Service squeezebox.unsync is deprecated; use media_player.unjoin_player instead"
+ "Service squeezebox.unsync is deprecated; use media_player.unjoin_player"
+ " instead"
)
await self.async_unjoin_player()
diff --git a/homeassistant/components/statistics/sensor.py b/homeassistant/components/statistics/sensor.py
index 64e967604c1..38434c15a1c 100644
--- a/homeassistant/components/statistics/sensor.py
+++ b/homeassistant/components/statistics/sensor.py
@@ -191,9 +191,8 @@ def valid_state_characteristic_configuration(config: dict[str, Any]) -> dict[str
not is_binary and characteristic not in STATS_NUMERIC_SUPPORT
):
raise vol.ValueInvalid(
- "The configured characteristic '{}' is not supported for the configured source sensor".format(
- characteristic
- )
+ "The configured characteristic '{}' is not supported for the configured"
+ " source sensor".format(characteristic)
)
return config
diff --git a/homeassistant/components/stream/recorder.py b/homeassistant/components/stream/recorder.py
index fffbd489757..258457a3d82 100644
--- a/homeassistant/components/stream/recorder.py
+++ b/homeassistant/components/stream/recorder.py
@@ -180,7 +180,10 @@ class RecorderOutput(StreamOutput):
write_transform_matrix_and_rename(video_path)
except FileNotFoundError:
_LOGGER.error(
- "Error writing to '%s'. There are likely multiple recordings writing to the same file",
+ (
+ "Error writing to '%s'. There are likely multiple recordings"
+ " writing to the same file"
+ ),
video_path,
)
diff --git a/homeassistant/components/stream/worker.py b/homeassistant/components/stream/worker.py
index aa49a6de7ae..308340f74a6 100644
--- a/homeassistant/components/stream/worker.py
+++ b/homeassistant/components/stream/worker.py
@@ -442,7 +442,8 @@ class TimestampValidator:
gap = packet.time_base * (prev_dts - packet.dts)
if gap > MAX_TIMESTAMP_GAP:
raise StreamWorkerError(
- f"Timestamp overflow detected: last dts = {prev_dts}, dts = {packet.dts}"
+ f"Timestamp overflow detected: last dts = {prev_dts}, dts ="
+ f" {packet.dts}"
)
return False
self._last_dts[packet.stream] = packet.dts
@@ -496,7 +497,8 @@ def stream_worker(
container = av.open(source, options=pyav_options, timeout=SOURCE_TIMEOUT)
except av.AVError as err:
raise StreamWorkerError(
- f"Error opening stream ({err.type}, {err.strerror}) {redact_credentials(str(source))}"
+ f"Error opening stream ({err.type}, {err.strerror})"
+ f" {redact_credentials(str(source))}"
) from err
try:
video_stream = container.streams.video[0]
diff --git a/homeassistant/components/switchbee/cover.py b/homeassistant/components/switchbee/cover.py
index f317a0e1db8..a9eed00801a 100644
--- a/homeassistant/components/switchbee/cover.py
+++ b/homeassistant/components/switchbee/cover.py
@@ -144,7 +144,8 @@ class SwitchBeeCoverEntity(SwitchBeeDeviceEntity[SwitchBeeShutter], CoverEntity)
await self.coordinator.api.set_state(self._device.id, kwargs[ATTR_POSITION])
except (SwitchBeeError, SwitchBeeTokenError) as exp:
raise HomeAssistantError(
- f"Failed to set {self.name} position to {kwargs[ATTR_POSITION]}, error: {str(exp)}"
+ f"Failed to set {self.name} position to {kwargs[ATTR_POSITION]}, error:"
+ f" {str(exp)}"
) from exp
self._get_coordinator_device().position = kwargs[ATTR_POSITION]
diff --git a/homeassistant/components/switchbee/entity.py b/homeassistant/components/switchbee/entity.py
index 6d312b7be22..7e5df69fb6d 100644
--- a/homeassistant/components/switchbee/entity.py
+++ b/homeassistant/components/switchbee/entity.py
@@ -98,7 +98,10 @@ class SwitchBeeDeviceEntity(SwitchBeeEntity[_DeviceTypeT]):
if self._is_online:
_LOGGER.warning(
- "%s device is not responding, check the status in the SwitchBee mobile app",
+ (
+ "%s device is not responding, check the status in the SwitchBee"
+ " mobile app"
+ ),
self.name,
)
self._is_online = False
diff --git a/homeassistant/components/switcher_kis/__init__.py b/homeassistant/components/switcher_kis/__init__.py
index 39710be4857..b51e561ddf6 100644
--- a/homeassistant/components/switcher_kis/__init__.py
+++ b/homeassistant/components/switcher_kis/__init__.py
@@ -141,7 +141,8 @@ class SwitcherDataUpdateCoordinator(update_coordinator.DataUpdateCoordinator):
async def _async_update_data(self) -> None:
"""Mark device offline if no data."""
raise update_coordinator.UpdateFailed(
- f"Device {self.name} did not send update for {MAX_UPDATE_INTERVAL_SEC} seconds"
+ f"Device {self.name} did not send update for"
+ f" {MAX_UPDATE_INTERVAL_SEC} seconds"
)
@property
diff --git a/homeassistant/components/switcher_kis/button.py b/homeassistant/components/switcher_kis/button.py
index 756acc1366e..8ecd12bc56a 100644
--- a/homeassistant/components/switcher_kis/button.py
+++ b/homeassistant/components/switcher_kis/button.py
@@ -153,6 +153,5 @@ class SwitcherThermostatButtonEntity(
self.coordinator.last_update_success = False
self.async_write_ha_state()
raise HomeAssistantError(
- f"Call api for {self.name} failed, "
- f"response/error: {response or error}"
+ f"Call api for {self.name} failed, response/error: {response or error}"
)
diff --git a/homeassistant/components/syncthing/__init__.py b/homeassistant/components/syncthing/__init__.py
index 3950f908e85..15f9bc7d307 100644
--- a/homeassistant/components/syncthing/__init__.py
+++ b/homeassistant/components/syncthing/__init__.py
@@ -153,7 +153,10 @@ class SyncthingClient:
)
except aiosyncthing.exceptions.SyncthingError:
_LOGGER.info(
- "The syncthing server '%s' is not available. Sleeping %i seconds and retrying",
+ (
+ "The syncthing server '%s' is not available. Sleeping %i"
+ " seconds and retrying"
+ ),
self._client.url,
RECONNECT_INTERVAL.total_seconds(),
)
diff --git a/homeassistant/components/synology_dsm/common.py b/homeassistant/components/synology_dsm/common.py
index f57262e2a57..847fc6061c3 100644
--- a/homeassistant/components/synology_dsm/common.py
+++ b/homeassistant/components/synology_dsm/common.py
@@ -98,7 +98,8 @@ class SynoApi:
self._with_surveillance_station = False
self.dsm.reset(SynoSurveillanceStation.API_KEY)
LOGGER.info(
- "Surveillance Station found, but disabled due to missing user permissions"
+ "Surveillance Station found, but disabled due to missing user"
+ " permissions"
)
LOGGER.debug(
diff --git a/homeassistant/components/synology_dsm/service.py b/homeassistant/components/synology_dsm/service.py
index 0cb2bf7d822..9797b808617 100644
--- a/homeassistant/components/synology_dsm/service.py
+++ b/homeassistant/components/synology_dsm/service.py
@@ -43,7 +43,10 @@ async def async_setup_services(hass: HomeAssistant) -> None:
return
LOGGER.debug("%s DSM with serial %s", call.service, serial)
LOGGER.warning(
- "The %s service is deprecated and will be removed in future release. Please use the corresponding button entity",
+ (
+ "The %s service is deprecated and will be removed in future"
+ " release. Please use the corresponding button entity"
+ ),
call.service,
)
dsm_device = hass.data[DOMAIN][serial]
diff --git a/homeassistant/components/system_bridge/__init__.py b/homeassistant/components/system_bridge/__init__.py
index 392273dee45..a8d3a4372ca 100644
--- a/homeassistant/components/system_bridge/__init__.py
+++ b/homeassistant/components/system_bridge/__init__.py
@@ -66,7 +66,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
try:
if not await version.check_supported():
raise ConfigEntryNotReady(
- f"You are not running a supported version of System Bridge. Please update to {SUPPORTED_VERSION} or higher."
+ "You are not running a supported version of System Bridge. Please"
+ f" update to {SUPPORTED_VERSION} or higher."
)
except AuthenticationException as exception:
_LOGGER.error("Authentication failed for %s: %s", entry.title, exception)
diff --git a/homeassistant/components/system_health/__init__.py b/homeassistant/components/system_health/__init__.py
index 4821537fc8b..9f45108d61e 100644
--- a/homeassistant/components/system_health/__init__.py
+++ b/homeassistant/components/system_health/__init__.py
@@ -37,7 +37,8 @@ def async_register_info(
Deprecated.
"""
_LOGGER.warning(
- "Calling system_health.async_register_info is deprecated; Add a system_health platform instead"
+ "Calling system_health.async_register_info is deprecated; Add a system_health"
+ " platform instead"
)
hass.data.setdefault(DOMAIN, {})
SystemHealthRegistration(hass, domain).async_register_info(info_callback)
diff --git a/homeassistant/components/systemmonitor/sensor.py b/homeassistant/components/systemmonitor/sensor.py
index fca06e37caa..8dc04e7da86 100644
--- a/homeassistant/components/systemmonitor/sensor.py
+++ b/homeassistant/components/systemmonitor/sensor.py
@@ -407,7 +407,10 @@ async def async_setup_sensor_registry_updates(
"""Update all sensors in one executor jump."""
if _update_lock.locked():
_LOGGER.warning(
- "Updating systemmonitor took longer than the scheduled update interval %s",
+ (
+ "Updating systemmonitor took longer than the scheduled update"
+ " interval %s"
+ ),
scan_interval,
)
return
diff --git a/homeassistant/components/tado/__init__.py b/homeassistant/components/tado/__init__.py
index 4b4d46883ce..9146d4d83d1 100644
--- a/homeassistant/components/tado/__init__.py
+++ b/homeassistant/components/tado/__init__.py
@@ -282,7 +282,10 @@ class TadoConnector:
):
"""Set a zone overlay."""
_LOGGER.debug(
- "Set overlay for zone %s: overlay_mode=%s, temp=%s, duration=%s, type=%s, mode=%s fan_speed=%s swing=%s",
+ (
+ "Set overlay for zone %s: overlay_mode=%s, temp=%s, duration=%s,"
+ " type=%s, mode=%s fan_speed=%s swing=%s"
+ ),
zone_id,
overlay_mode,
temperature,
diff --git a/homeassistant/components/tado/climate.py b/homeassistant/components/tado/climate.py
index f91e0f45b75..b913993a4e1 100644
--- a/homeassistant/components/tado/climate.py
+++ b/homeassistant/components/tado/climate.py
@@ -598,7 +598,10 @@ class TadoClimate(TadoZoneEntity, ClimateEntity):
)
_LOGGER.debug(
- "Switching to %s for zone %s (%d) with temperature %s °C and duration %s using overlay %s",
+ (
+ "Switching to %s for zone %s (%d) with temperature %s °C and duration"
+ " %s using overlay %s"
+ ),
self._current_tado_hvac_mode,
self.zone_name,
self.zone_id,
diff --git a/homeassistant/components/tado/entity.py b/homeassistant/components/tado/entity.py
index 40e06313fa8..11de7ceb314 100644
--- a/homeassistant/components/tado/entity.py
+++ b/homeassistant/components/tado/entity.py
@@ -67,7 +67,9 @@ class TadoZoneEntity(Entity):
def device_info(self) -> DeviceInfo:
"""Return the device_info of the device."""
return DeviceInfo(
- configuration_url=f"https://app.tado.com/en/main/home/zoneV2/{self.zone_id}",
+ configuration_url=(
+ f"https://app.tado.com/en/main/home/zoneV2/{self.zone_id}"
+ ),
identifiers={(DOMAIN, self._device_zone_id)},
name=self.zone_name,
manufacturer=DEFAULT_NAME,
diff --git a/homeassistant/components/tankerkoenig/config_flow.py b/homeassistant/components/tankerkoenig/config_flow.py
index be223e95713..5441ddeb52c 100644
--- a/homeassistant/components/tankerkoenig/config_flow.py
+++ b/homeassistant/components/tankerkoenig/config_flow.py
@@ -118,9 +118,10 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
if len(stations := data.get("stations", [])) == 0:
return self._show_form_user(user_input, errors={CONF_RADIUS: "no_stations"})
for station in stations:
- self._stations[
- station["id"]
- ] = f"{station['brand']} {station['street']} {station['houseNumber']} - ({station['dist']}km)"
+ self._stations[station["id"]] = (
+ f"{station['brand']} {station['street']} {station['houseNumber']} -"
+ f" ({station['dist']}km)"
+ )
self._data = user_input
@@ -268,9 +269,10 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
)
if stations := nearby_stations.get("stations"):
for station in stations:
- self._stations[
- station["id"]
- ] = f"{station['brand']} {station['street']} {station['houseNumber']} - ({station['dist']}km)"
+ self._stations[station["id"]] = (
+ f"{station['brand']} {station['street']} {station['houseNumber']} -"
+ f" ({station['dist']}km)"
+ )
# add possible extra selected stations from import
for selected_station in self.config_entry.data[CONF_STATIONS]:
diff --git a/homeassistant/components/tasmota/discovery.py b/homeassistant/components/tasmota/discovery.py
index 8afac859b88..4ab3f780ad3 100644
--- a/homeassistant/components/tasmota/discovery.py
+++ b/homeassistant/components/tasmota/discovery.py
@@ -85,7 +85,10 @@ def warn_if_topic_duplicated(
for _, cfg in offenders
]
_LOGGER.warning(
- "Multiple Tasmota devices are sharing the same topic '%s'. Offending devices: %s",
+ (
+ "Multiple Tasmota devices are sharing the same topic '%s'. Offending"
+ " devices: %s"
+ ),
command_topic,
", ".join(offender_strings),
)
diff --git a/homeassistant/components/tcp/common.py b/homeassistant/components/tcp/common.py
index d2d40358970..31f230d3b23 100644
--- a/homeassistant/components/tcp/common.py
+++ b/homeassistant/components/tcp/common.py
@@ -131,8 +131,10 @@ class TcpEntity(Entity):
readable, _, _ = select.select([sock], [], [], self._config[CONF_TIMEOUT])
if not readable:
_LOGGER.warning(
- "Timeout (%s second(s)) waiting for a response after "
- "sending %r to %s on port %s",
+ (
+ "Timeout (%s second(s)) waiting for a response after "
+ "sending %r to %s on port %s"
+ ),
self._config[CONF_TIMEOUT],
self._config[CONF_PAYLOAD],
self._config[CONF_HOST],