diff --git a/homeassistant/components/advantage_air/binary_sensor.py b/homeassistant/components/advantage_air/binary_sensor.py index 2ad8c2217a2..601b10aeb4a 100644 --- a/homeassistant/components/advantage_air/binary_sensor.py +++ b/homeassistant/components/advantage_air/binary_sensor.py @@ -66,7 +66,7 @@ class AdvantageAirZoneMotion(AdvantageAirZoneEntity, BinarySensorEntity): def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None: """Initialize an Advantage Air Zone Motion sensor.""" super().__init__(instance, ac_key, zone_key) - self._attr_name = f'{self._zone["name"]} motion' + self._attr_name = f"{self._zone['name']} motion" self._attr_unique_id += "-motion" @property @@ -84,7 +84,7 @@ class AdvantageAirZoneMyZone(AdvantageAirZoneEntity, BinarySensorEntity): def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None: """Initialize an Advantage Air Zone MyZone sensor.""" super().__init__(instance, ac_key, zone_key) - self._attr_name = f'{self._zone["name"]} myZone' + self._attr_name = f"{self._zone['name']} myZone" self._attr_unique_id += "-myzone" @property diff --git a/homeassistant/components/advantage_air/sensor.py b/homeassistant/components/advantage_air/sensor.py index bd3fa970fb9..ab1a1c4f9a0 100644 --- a/homeassistant/components/advantage_air/sensor.py +++ b/homeassistant/components/advantage_air/sensor.py @@ -103,7 +103,7 @@ class AdvantageAirZoneVent(AdvantageAirZoneEntity, SensorEntity): def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None: """Initialize an Advantage Air Zone Vent Sensor.""" super().__init__(instance, ac_key, zone_key=zone_key) - self._attr_name = f'{self._zone["name"]} vent' + self._attr_name = f"{self._zone['name']} vent" self._attr_unique_id += "-vent" @property @@ -131,7 +131,7 @@ class AdvantageAirZoneSignal(AdvantageAirZoneEntity, SensorEntity): def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None: """Initialize an Advantage Air Zone wireless signal sensor.""" super().__init__(instance, ac_key, zone_key) - self._attr_name = f'{self._zone["name"]} signal' + self._attr_name = f"{self._zone['name']} signal" self._attr_unique_id += "-signal" @property @@ -165,7 +165,7 @@ class AdvantageAirZoneTemp(AdvantageAirZoneEntity, SensorEntity): def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None: """Initialize an Advantage Air Zone Temp Sensor.""" super().__init__(instance, ac_key, zone_key) - self._attr_name = f'{self._zone["name"]} temperature' + self._attr_name = f"{self._zone['name']} temperature" self._attr_unique_id += "-temp" @property diff --git a/homeassistant/components/airthings/sensor.py b/homeassistant/components/airthings/sensor.py index f35d5c9667c..1b604d72032 100644 --- a/homeassistant/components/airthings/sensor.py +++ b/homeassistant/components/airthings/sensor.py @@ -155,8 +155,7 @@ class AirthingsHeaterEnergySensor( self._id = airthings_device.device_id self._attr_device_info = DeviceInfo( configuration_url=( - "https://dashboard.airthings.com/devices/" - f"{airthings_device.device_id}" + f"https://dashboard.airthings.com/devices/{airthings_device.device_id}" ), identifiers={(DOMAIN, airthings_device.device_id)}, name=airthings_device.name, diff --git a/homeassistant/components/airvisual_pro/sensor.py b/homeassistant/components/airvisual_pro/sensor.py index 66726832843..58ad730bc31 100644 --- a/homeassistant/components/airvisual_pro/sensor.py +++ b/homeassistant/components/airvisual_pro/sensor.py @@ -50,7 +50,7 @@ SENSOR_DESCRIPTIONS = ( state_class=SensorStateClass.MEASUREMENT, value_fn=lambda settings, status, measurements, history: int( history.get( - f'Outdoor {"AQI(US)" if settings["is_aqi_usa"] else "AQI(CN)"}', -1 + f"Outdoor {'AQI(US)' if settings['is_aqi_usa'] else 'AQI(CN)'}", -1 ) ), translation_key="outdoor_air_quality_index", diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index bd8af526d75..955a6215096 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -636,9 +636,9 @@ class AutomationEntity(BaseAutomationEntity, RestoreEntity): alias = "" if "trigger" in run_variables: if "description" in run_variables["trigger"]: - reason = f' by {run_variables["trigger"]["description"]}' + reason = f" by {run_variables['trigger']['description']}" if "alias" in run_variables["trigger"]: - alias = f' trigger \'{run_variables["trigger"]["alias"]}\'' + alias = f" trigger '{run_variables['trigger']['alias']}'" self._logger.debug("Automation%s triggered%s", alias, reason) # Create a new context referring to the old context. diff --git a/homeassistant/components/balboa/entity.py b/homeassistant/components/balboa/entity.py index a7d75bfbdf5..a541d044a21 100644 --- a/homeassistant/components/balboa/entity.py +++ b/homeassistant/components/balboa/entity.py @@ -20,7 +20,7 @@ class BalboaEntity(Entity): """Initialize the control.""" mac = client.mac_address model = client.model - self._attr_unique_id = f'{model}-{key}-{mac.replace(":","")[-6:]}' + self._attr_unique_id = f"{model}-{key}-{mac.replace(':', '')[-6:]}" self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, mac)}, name=model, diff --git a/homeassistant/components/blueprint/importer.py b/homeassistant/components/blueprint/importer.py index 32fe7b56495..544f9554b9f 100644 --- a/homeassistant/components/blueprint/importer.py +++ b/homeassistant/components/blueprint/importer.py @@ -136,7 +136,7 @@ def _extract_blueprint_from_community_topic( ) return ImportedBlueprint( - f'{post["username"]}/{topic["slug"]}', block_content, blueprint + f"{post['username']}/{topic['slug']}", block_content, blueprint ) diff --git a/homeassistant/components/bthome/logbook.py b/homeassistant/components/bthome/logbook.py index be5e156e99c..32e90118dea 100644 --- a/homeassistant/components/bthome/logbook.py +++ b/homeassistant/components/bthome/logbook.py @@ -26,7 +26,7 @@ def async_describe_events( """Describe bthome logbook event.""" data = event.data device = dev_reg.async_get(data["device_id"]) - name = device and device.name or f'BTHome {data["address"]}' + name = device and device.name or f"BTHome {data['address']}" if properties := data["event_properties"]: message = f"{data['event_class']} {data['event_type']}: {properties}" else: diff --git a/homeassistant/components/compensation/__init__.py b/homeassistant/components/compensation/__init__.py index fae416e7fc2..e83339d2c18 100644 --- a/homeassistant/components/compensation/__init__.py +++ b/homeassistant/components/compensation/__init__.py @@ -42,7 +42,7 @@ def datapoints_greater_than_degree(value: dict) -> dict: if len(value[CONF_DATAPOINTS]) <= value[CONF_DEGREE]: raise vol.Invalid( f"{CONF_DATAPOINTS} must have at least" - f" {value[CONF_DEGREE]+1} {CONF_DATAPOINTS}" + f" {value[CONF_DEGREE] + 1} {CONF_DATAPOINTS}" ) return value diff --git a/homeassistant/components/doods/image_processing.py b/homeassistant/components/doods/image_processing.py index 51633d0e05d..7b055c6dd05 100644 --- a/homeassistant/components/doods/image_processing.py +++ b/homeassistant/components/doods/image_processing.py @@ -266,7 +266,7 @@ class Doods(ImageProcessingEntity): # Draw detected objects for instance in values: - box_label = f'{label} {instance["score"]:.1f}%' + box_label = f"{label} {instance['score']:.1f}%" # Already scaled, use 1 for width and height draw_box( draw, diff --git a/homeassistant/components/duke_energy/coordinator.py b/homeassistant/components/duke_energy/coordinator.py index 68b7db12d45..2b0ae46b405 100644 --- a/homeassistant/components/duke_energy/coordinator.py +++ b/homeassistant/components/duke_energy/coordinator.py @@ -85,7 +85,7 @@ class DukeEnergyCoordinator(DataUpdateCoordinator[None]): ) continue - id_prefix = f"{meter["serviceType"].lower()}_{serial_number}" + id_prefix = f"{meter['serviceType'].lower()}_{serial_number}" consumption_statistic_id = f"{DOMAIN}:{id_prefix}_energy_consumption" self._statistic_ids.add(consumption_statistic_id) _LOGGER.debug( @@ -136,7 +136,7 @@ class DukeEnergyCoordinator(DataUpdateCoordinator[None]): ) name_prefix = ( - f"Duke Energy " f"{meter["serviceType"].capitalize()} {serial_number}" + f"Duke Energy {meter['serviceType'].capitalize()} {serial_number}" ) consumption_metadata = StatisticMetaData( has_mean=False, diff --git a/homeassistant/components/ecobee/climate.py b/homeassistant/components/ecobee/climate.py index 709926d8496..bfb2635481c 100644 --- a/homeassistant/components/ecobee/climate.py +++ b/homeassistant/components/ecobee/climate.py @@ -603,7 +603,7 @@ class Thermostat(ClimateEntity): """Return the remote sensor device name_by_user or name for the thermostat.""" return sorted( [ - f'{item["name_by_user"]} ({item["id"]})' + f"{item['name_by_user']} ({item['id']})" for item in self.remote_sensor_ids_names ] ) @@ -873,7 +873,7 @@ class Thermostat(ClimateEntity): translation_placeholders={ "options": ", ".join( [ - f'{item["name_by_user"]} ({item["id"]})' + f"{item['name_by_user']} ({item['id']})" for item in self.remote_sensor_ids_names ] ) diff --git a/homeassistant/components/ecobee/notify.py b/homeassistant/components/ecobee/notify.py index 28cfbebe506..70860003b2a 100644 --- a/homeassistant/components/ecobee/notify.py +++ b/homeassistant/components/ecobee/notify.py @@ -34,7 +34,7 @@ class EcobeeNotifyEntity(EcobeeBaseEntity, NotifyEntity): """Initialize the thermostat.""" super().__init__(data, thermostat_index) self._attr_unique_id = ( - f"{self.thermostat["identifier"]}_notify_{thermostat_index}" + f"{self.thermostat['identifier']}_notify_{thermostat_index}" ) def send_message(self, message: str, title: str | None = None) -> None: diff --git a/homeassistant/components/flux_led/__init__.py b/homeassistant/components/flux_led/__init__.py index 1472dfa4bf1..7597a7c9c9a 100644 --- a/homeassistant/components/flux_led/__init__.py +++ b/homeassistant/components/flux_led/__init__.py @@ -133,7 +133,7 @@ async def _async_migrate_unique_ids(hass: HomeAssistant, entry: ConfigEntry) -> and mac_matches_by_one(entity_mac, unique_id) ): # Old format {dhcp_mac}....., New format {discovery_mac}.... - new_unique_id = f"{unique_id}{entity_unique_id[len(unique_id):]}" + new_unique_id = f"{unique_id}{entity_unique_id[len(unique_id) :]}" else: return None _LOGGER.debug( diff --git a/homeassistant/components/fronius/sensor.py b/homeassistant/components/fronius/sensor.py index 03f666ffafd..c6c3ff4b602 100644 --- a/homeassistant/components/fronius/sensor.py +++ b/homeassistant/components/fronius/sensor.py @@ -794,7 +794,7 @@ class LoggerSensor(_FroniusSensorEntity): "unit" ) self._attr_unique_id = ( - f'{logger_data["unique_identifier"]["value"]}-{description.key}' + f"{logger_data['unique_identifier']['value']}-{description.key}" ) @@ -815,7 +815,7 @@ class MeterSensor(_FroniusSensorEntity): if (meter_uid := meter_data["serial"]["value"]) == "n.a.": meter_uid = ( f"{coordinator.solar_net.solar_net_device_id}:" - f'{meter_data["model"]["value"]}' + f"{meter_data['model']['value']}" ) self._attr_device_info = DeviceInfo( @@ -849,7 +849,7 @@ class OhmpilotSensor(_FroniusSensorEntity): sw_version=device_data["software"]["value"], via_device=(DOMAIN, coordinator.solar_net.solar_net_device_id), ) - self._attr_unique_id = f'{device_data["serial"]["value"]}-{description.key}' + self._attr_unique_id = f"{device_data['serial']['value']}-{description.key}" class PowerFlowSensor(_FroniusSensorEntity): @@ -883,7 +883,7 @@ class StorageSensor(_FroniusSensorEntity): super().__init__(coordinator, description, solar_net_id) storage_data = self._device_data() - self._attr_unique_id = f'{storage_data["serial"]["value"]}-{description.key}' + self._attr_unique_id = f"{storage_data['serial']['value']}-{description.key}" self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, storage_data["serial"]["value"])}, manufacturer=storage_data["manufacturer"]["value"], diff --git a/homeassistant/components/harmony/data.py b/homeassistant/components/harmony/data.py index 41c55bfc855..4dba412a17c 100644 --- a/homeassistant/components/harmony/data.py +++ b/homeassistant/components/harmony/data.py @@ -124,8 +124,7 @@ class HarmonyData(HarmonySubscriberMixin): except (ValueError, AttributeError) as err: await self._client.close() raise ConfigEntryNotReady( - f"{self.name}: Error {err} while connected HUB at:" - f" {self._address}:8088" + f"{self.name}: Error {err} while connected HUB at: {self._address}:8088" ) from err if not connected: await self._client.close() diff --git a/homeassistant/components/hisense_aehw4a1/climate.py b/homeassistant/components/hisense_aehw4a1/climate.py index 68f79439162..1dc1eaabcaa 100644 --- a/homeassistant/components/hisense_aehw4a1/climate.py +++ b/homeassistant/components/hisense_aehw4a1/climate.py @@ -195,7 +195,7 @@ class ClimateAehW4a1(ClimateEntity): fan_mode = status["wind_status"] self._attr_fan_mode = AC_TO_HA_FAN_MODES[fan_mode] - swing_mode = f'{status["up_down"]}{status["left_right"]}' + swing_mode = f"{status['up_down']}{status['left_right']}" self._attr_swing_mode = AC_TO_HA_SWING[swing_mode] if self._attr_hvac_mode in (HVACMode.COOL, HVACMode.HEAT): diff --git a/homeassistant/components/hive/entity.py b/homeassistant/components/hive/entity.py index 1209e8c8f05..f5648690201 100644 --- a/homeassistant/components/hive/entity.py +++ b/homeassistant/components/hive/entity.py @@ -21,7 +21,7 @@ class HiveEntity(Entity): self.hive = hive self.device = hive_device self._attr_name = self.device["haName"] - self._attr_unique_id = f'{self.device["hiveID"]}-{self.device["hiveType"]}' + self._attr_unique_id = f"{self.device['hiveID']}-{self.device['hiveType']}" self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, self.device["device_id"])}, model=self.device["deviceData"]["model"], diff --git a/homeassistant/components/homekit/iidmanager.py b/homeassistant/components/homekit/iidmanager.py index d6daeb49f82..a477dde9c9d 100644 --- a/homeassistant/components/homekit/iidmanager.py +++ b/homeassistant/components/homekit/iidmanager.py @@ -102,8 +102,8 @@ class AccessoryIIDStorage: char_hap_type: str | None = uuid_to_hap_type(char_uuid) if char_uuid else None # Allocation key must be a string since we are saving it to JSON allocation_key = ( - f'{service_hap_type}_{service_unique_id or ""}_' - f'{char_hap_type or ""}_{char_unique_id or ""}' + f"{service_hap_type}_{service_unique_id or ''}_" + f"{char_hap_type or ''}_{char_unique_id or ''}" ) # AID must be a string since JSON keys cannot be int aid_str = str(aid) diff --git a/homeassistant/components/homekit/type_triggers.py b/homeassistant/components/homekit/type_triggers.py index b958817bbac..f32c4f55a0f 100644 --- a/homeassistant/components/homekit/type_triggers.py +++ b/homeassistant/components/homekit/type_triggers.py @@ -48,7 +48,7 @@ class DeviceTriggerAccessory(HomeAccessory): for idx, trigger in enumerate(device_triggers): type_: str = trigger["type"] subtype: str | None = trigger.get("subtype") - unique_id = f'{type_}-{subtype or ""}' + unique_id = f"{type_}-{subtype or ''}" entity_id: str | None = None if (entity_id_or_uuid := trigger.get("entity_id")) and ( entry := ent_reg.async_get(entity_id_or_uuid) @@ -122,7 +122,7 @@ class DeviceTriggerAccessory(HomeAccessory): """ reason = "" if "trigger" in run_variables and "description" in run_variables["trigger"]: - reason = f' by {run_variables["trigger"]["description"]}' + reason = f" by {run_variables['trigger']['description']}" _LOGGER.debug("Button triggered%s - %s", reason, run_variables) idx = int(run_variables["trigger"]["idx"]) self.triggers[idx].set_value(0) diff --git a/homeassistant/components/homekit_controller/connection.py b/homeassistant/components/homekit_controller/connection.py index 52f22bcc9f4..211aec2c2d5 100644 --- a/homeassistant/components/homekit_controller/connection.py +++ b/homeassistant/components/homekit_controller/connection.py @@ -323,8 +323,7 @@ class HKDevice: self.hass, self.async_update_available_state, timedelta(seconds=BLE_AVAILABILITY_CHECK_INTERVAL), - name=f"HomeKit Device {self.unique_id} BLE availability " - "check poll", + name=f"HomeKit Device {self.unique_id} BLE availability check poll", ) ) # BLE devices always get an RSSI sensor as well diff --git a/homeassistant/components/ihc/entity.py b/homeassistant/components/ihc/entity.py index f73c3079867..f90b2ee943c 100644 --- a/homeassistant/components/ihc/entity.py +++ b/homeassistant/components/ihc/entity.py @@ -43,7 +43,7 @@ class IHCEntity(Entity): self.suggested_area = product.get("group") if "id" in product: product_id = product["id"] - self.device_id = f"{controller_id}_{product_id }" + self.device_id = f"{controller_id}_{product_id}" # this will name the device the same way as the IHC visual application: Product name + position self.device_name = product["name"] if self.ihc_position: diff --git a/homeassistant/components/ista_ecotrend/config_flow.py b/homeassistant/components/ista_ecotrend/config_flow.py index c11c43070df..1a3b2109d0c 100644 --- a/homeassistant/components/ista_ecotrend/config_flow.py +++ b/homeassistant/components/ista_ecotrend/config_flow.py @@ -66,7 +66,7 @@ class IstaConfigFlow(ConfigFlow, domain=DOMAIN): else: if TYPE_CHECKING: assert info - title = f"{info["firstName"]} {info["lastName"]}".strip() + title = f"{info['firstName']} {info['lastName']}".strip() await self.async_set_unique_id(info["activeConsumptionUnit"]) self._abort_if_unique_id_configured() return self.async_create_entry( diff --git a/homeassistant/components/isy994/select.py b/homeassistant/components/isy994/select.py index 41e5899504d..8befcf024d1 100644 --- a/homeassistant/components/isy994/select.py +++ b/homeassistant/components/isy994/select.py @@ -45,7 +45,7 @@ from .models import IsyData def time_string(i: int) -> str: """Return a formatted ramp rate time string.""" if i >= 60: - return f"{(float(i)/60):.1f} {UnitOfTime.MINUTES}" + return f"{(float(i) / 60):.1f} {UnitOfTime.MINUTES}" return f"{i} {UnitOfTime.SECONDS}" diff --git a/homeassistant/components/keymitt_ble/config_flow.py b/homeassistant/components/keymitt_ble/config_flow.py index 217ce3cc923..821fbc410f7 100644 --- a/homeassistant/components/keymitt_ble/config_flow.py +++ b/homeassistant/components/keymitt_ble/config_flow.py @@ -34,7 +34,7 @@ def short_address(address: str) -> str: def name_from_discovery(discovery: MicroBotAdvertisement) -> str: """Get the name from a discovery.""" - return f'{discovery.data["local_name"]} {short_address(discovery.address)}' + return f"{discovery.data['local_name']} {short_address(discovery.address)}" class MicroBotConfigFlow(ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/knx/expose.py b/homeassistant/components/knx/expose.py index 82bee48ba69..6585b848d8a 100644 --- a/homeassistant/components/knx/expose.py +++ b/homeassistant/components/knx/expose.py @@ -88,7 +88,7 @@ class KNXExposeSensor: self._remove_listener: Callable[[], None] | None = None self.device: ExposeSensor = ExposeSensor( xknx=self.xknx, - name=f"{self.entity_id}__{self.expose_attribute or "state"}", + name=f"{self.entity_id}__{self.expose_attribute or 'state'}", group_address=config[KNX_ADDRESS], respond_to_read=config[CONF_RESPOND_TO_READ], value_type=self.expose_type, diff --git a/homeassistant/components/kostal_plenticore/coordinator.py b/homeassistant/components/kostal_plenticore/coordinator.py index fa6aa92856b..5f4393146f0 100644 --- a/homeassistant/components/kostal_plenticore/coordinator.py +++ b/homeassistant/components/kostal_plenticore/coordinator.py @@ -101,8 +101,8 @@ class Plenticore: model=f"{prod1} {prod2}", name=settings["scb:network"][hostname_id], sw_version=( - f'IOC: {device_local["Properties:VersionIOC"]}' - f' MC: {device_local["Properties:VersionMC"]}' + f"IOC: {device_local['Properties:VersionIOC']}" + f" MC: {device_local['Properties:VersionMC']}" ), ) diff --git a/homeassistant/components/lacrosse_view/config_flow.py b/homeassistant/components/lacrosse_view/config_flow.py index ecf30f9a197..75a5c737034 100644 --- a/homeassistant/components/lacrosse_view/config_flow.py +++ b/homeassistant/components/lacrosse_view/config_flow.py @@ -40,7 +40,7 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> list[Loca raise InvalidAuth from error if not locations: - raise NoLocations(f'No locations found for account {data["username"]}') + raise NoLocations(f"No locations found for account {data['username']}") return locations diff --git a/homeassistant/components/lcn/helpers.py b/homeassistant/components/lcn/helpers.py index 348305c775e..b999c6f3770 100644 --- a/homeassistant/components/lcn/helpers.py +++ b/homeassistant/components/lcn/helpers.py @@ -90,9 +90,9 @@ def get_resource(domain_name: str, domain_data: ConfigType) -> str: if domain_name == "cover": return cast(str, domain_data["motor"]) if domain_name == "climate": - return f'{domain_data["source"]}.{domain_data["setpoint"]}' + return f"{domain_data['source']}.{domain_data['setpoint']}" if domain_name == "scene": - return f'{domain_data["register"]}.{domain_data["scene"]}' + return f"{domain_data['register']}.{domain_data['scene']}" raise ValueError("Unknown domain") diff --git a/homeassistant/components/lektrico/config_flow.py b/homeassistant/components/lektrico/config_flow.py index 7091856f4fd..77f7b60853d 100644 --- a/homeassistant/components/lektrico/config_flow.py +++ b/homeassistant/components/lektrico/config_flow.py @@ -116,7 +116,7 @@ class LektricoFlowHandler(ConfigFlow, domain=DOMAIN): self._serial_number = str(settings["serial_number"]) self._device_type = settings["type"] self._board_revision = settings["board_revision"] - self._name = f"{settings["type"]}_{self._serial_number}" + self._name = f"{settings['type']}_{self._serial_number}" # Check if already configured # Set unique id diff --git a/homeassistant/components/lg_thinq/mqtt.py b/homeassistant/components/lg_thinq/mqtt.py index 8759869aad3..025f80f78b1 100644 --- a/homeassistant/components/lg_thinq/mqtt.py +++ b/homeassistant/components/lg_thinq/mqtt.py @@ -168,7 +168,7 @@ class ThinQMQTT: async def async_handle_device_event(self, message: dict) -> None: """Handle received mqtt message.""" unique_id = ( - f"{message["deviceId"]}_{list(message["report"].keys())[0]}" + f"{message['deviceId']}_{list(message['report'].keys())[0]}" if message["deviceType"] == DeviceType.WASHTOWER else message["deviceId"] ) diff --git a/homeassistant/components/lovelace/cast.py b/homeassistant/components/lovelace/cast.py index 82a92b94ae5..c380a296fc0 100644 --- a/homeassistant/components/lovelace/cast.py +++ b/homeassistant/components/lovelace/cast.py @@ -101,7 +101,7 @@ async def async_browse_media( BrowseMedia( title=view["title"], media_class=MediaClass.APP, - media_content_id=f'{info["url_path"]}/{view["path"]}', + media_content_id=f"{info['url_path']}/{view['path']}", media_content_type=DOMAIN, thumbnail="https://brands.home-assistant.io/_/lovelace/logo.png", can_play=True, diff --git a/homeassistant/components/lutron_caseta/button.py b/homeassistant/components/lutron_caseta/button.py index a74de46346b..e56758b0af6 100644 --- a/homeassistant/components/lutron_caseta/button.py +++ b/homeassistant/components/lutron_caseta/button.py @@ -53,7 +53,7 @@ async def async_setup_entry( # Append the child device name to the end of the parent keypad # name to create the entity name - full_name = f'{parent_device_info.get("name")} {device_name}' + full_name = f"{parent_device_info.get('name')} {device_name}" # Set the device_info to the same as the Parent Keypad # The entities will be nested inside the keypad device entities.append( diff --git a/homeassistant/components/lutron_caseta/switch.py b/homeassistant/components/lutron_caseta/switch.py index 5037d077a02..66f23926fbf 100644 --- a/homeassistant/components/lutron_caseta/switch.py +++ b/homeassistant/components/lutron_caseta/switch.py @@ -44,7 +44,7 @@ class LutronCasetaLight(LutronCasetaUpdatableEntity, SwitchEntity): parent_keypad = keypads[device["parent_device"]] parent_device_info = parent_keypad["device_info"] # Append the child device name to the end of the parent keypad name to create the entity name - self._attr_name = f'{parent_device_info["name"]} {device["device_name"]}' + self._attr_name = f"{parent_device_info['name']} {device['device_name']}" # Set the device_info to the same as the Parent Keypad # The entities will be nested inside the keypad device self._attr_device_info = parent_device_info diff --git a/homeassistant/components/picnic/config_flow.py b/homeassistant/components/picnic/config_flow.py index 9548029209b..4c8281f21de 100644 --- a/homeassistant/components/picnic/config_flow.py +++ b/homeassistant/components/picnic/config_flow.py @@ -67,8 +67,8 @@ async def validate_input(hass: HomeAssistant, data): # Return the validation result address = ( - f'{user_data["address"]["street"]} {user_data["address"]["house_number"]}' - f'{user_data["address"]["house_number_ext"]}' + f"{user_data['address']['street']} {user_data['address']['house_number']}" + f"{user_data['address']['house_number_ext']}" ) return auth_token, { "title": address, diff --git a/homeassistant/components/progettihwsw/__init__.py b/homeassistant/components/progettihwsw/__init__.py index 1bf23befbdb..4d090f4d0c1 100644 --- a/homeassistant/components/progettihwsw/__init__.py +++ b/homeassistant/components/progettihwsw/__init__.py @@ -17,7 +17,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up ProgettiHWSW Automation from a config entry.""" hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN][entry.entry_id] = ProgettiHWSWAPI( - f'{entry.data["host"]}:{entry.data["port"]}' + f"{entry.data['host']}:{entry.data['port']}" ) # Check board validation again to load new values to API. diff --git a/homeassistant/components/progettihwsw/config_flow.py b/homeassistant/components/progettihwsw/config_flow.py index 2202678da9b..2e5ea221dca 100644 --- a/homeassistant/components/progettihwsw/config_flow.py +++ b/homeassistant/components/progettihwsw/config_flow.py @@ -19,7 +19,7 @@ DATA_SCHEMA = vol.Schema( async def validate_input(hass: HomeAssistant, data): """Validate the user host input.""" - api_instance = ProgettiHWSWAPI(f'{data["host"]}:{data["port"]}') + api_instance = ProgettiHWSWAPI(f"{data['host']}:{data['port']}") is_valid = await api_instance.check_board() if not is_valid: diff --git a/homeassistant/components/pyload/__init__.py b/homeassistant/components/pyload/__init__.py index 8b85dfa29a4..f07db509630 100644 --- a/homeassistant/components/pyload/__init__.py +++ b/homeassistant/components/pyload/__init__.py @@ -32,7 +32,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: PyLoadConfigEntry) -> bo """Set up pyLoad from a config entry.""" url = ( - f"{"https" if entry.data[CONF_SSL] else "http"}://" + f"{'https' if entry.data[CONF_SSL] else 'http'}://" f"{entry.data[CONF_HOST]}:{entry.data[CONF_PORT]}/" ) diff --git a/homeassistant/components/pyload/config_flow.py b/homeassistant/components/pyload/config_flow.py index c8d08f997f9..5df11711d6f 100644 --- a/homeassistant/components/pyload/config_flow.py +++ b/homeassistant/components/pyload/config_flow.py @@ -83,7 +83,7 @@ async def validate_input(hass: HomeAssistant, user_input: dict[str, Any]) -> Non ) url = ( - f"{"https" if user_input[CONF_SSL] else "http"}://" + f"{'https' if user_input[CONF_SSL] else 'http'}://" f"{user_input[CONF_HOST]}:{user_input[CONF_PORT]}/" ) pyload = PyLoadAPI( diff --git a/homeassistant/components/recorder/system_health/__init__.py b/homeassistant/components/recorder/system_health/__init__.py index 16feaa19886..6923b792b8b 100644 --- a/homeassistant/components/recorder/system_health/__init__.py +++ b/homeassistant/components/recorder/system_health/__init__.py @@ -40,7 +40,7 @@ def _get_db_stats(instance: Recorder, database_name: str) -> dict[str, Any]: and (get_size := DIALECT_TO_GET_SIZE.get(dialect_name)) and (db_bytes := get_size(session, database_name)) ): - db_stats["estimated_db_size"] = f"{db_bytes/1024/1024:.2f} MiB" + db_stats["estimated_db_size"] = f"{db_bytes / 1024 / 1024:.2f} MiB" return db_stats diff --git a/homeassistant/components/reolink/__init__.py b/homeassistant/components/reolink/__init__.py index dd791bbaf1a..747e68e8a00 100644 --- a/homeassistant/components/reolink/__init__.py +++ b/homeassistant/components/reolink/__init__.py @@ -361,7 +361,7 @@ def migrate_entity_ids( if host.api.supported(None, "UID") and not entity.unique_id.startswith( host.unique_id ): - new_id = f"{host.unique_id}_{entity.unique_id.split("_", 1)[1]}" + new_id = f"{host.unique_id}_{entity.unique_id.split('_', 1)[1]}" entity_reg.async_update_entity(entity.entity_id, new_unique_id=new_id) if entity.device_id in ch_device_ids: diff --git a/homeassistant/components/rfxtrx/sensor.py b/homeassistant/components/rfxtrx/sensor.py index 4f8ae9767e2..13f3c012af8 100644 --- a/homeassistant/components/rfxtrx/sensor.py +++ b/homeassistant/components/rfxtrx/sensor.py @@ -57,7 +57,7 @@ def _rssi_convert(value: int | None) -> str | None: """Rssi is given as dBm value.""" if value is None: return None - return f"{value*8-120}" + return f"{value * 8 - 120}" @dataclass(frozen=True) diff --git a/homeassistant/components/sense/entity.py b/homeassistant/components/sense/entity.py index 248be53ceb7..35c556a51f2 100644 --- a/homeassistant/components/sense/entity.py +++ b/homeassistant/components/sense/entity.py @@ -12,7 +12,7 @@ from .coordinator import SenseCoordinator def sense_to_mdi(sense_icon: str) -> str: """Convert sense icon to mdi icon.""" - return f"mdi:{MDI_ICONS.get(sense_icon, "power-plug")}" + return f"mdi:{MDI_ICONS.get(sense_icon, 'power-plug')}" class SenseEntity(CoordinatorEntity[SenseCoordinator]): diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index 940343fc069..f8e157a6a5d 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -557,7 +557,7 @@ class RpcBluTrvClimate(ShellyRpcEntity, ClimateEntity): self._config = coordinator.device.config[f"{BLU_TRV_IDENTIFIER}:{id_}"] ble_addr: str = self._config["addr"] self._attr_unique_id = f"{ble_addr}-{self.key}" - name = self._config["name"] or f"shellyblutrv-{ble_addr.replace(":", "")}" + name = self._config["name"] or f"shellyblutrv-{ble_addr.replace(':', '')}" model_id = self._config.get("local_name") self._attr_device_info = DeviceInfo( connections={(CONNECTION_BLUETOOTH, ble_addr)}, diff --git a/homeassistant/components/shelly/logbook.py b/homeassistant/components/shelly/logbook.py index fbf72e6ebe8..e18cd7ca465 100644 --- a/homeassistant/components/shelly/logbook.py +++ b/homeassistant/components/shelly/logbook.py @@ -42,7 +42,7 @@ def async_describe_events( if click_type in RPC_INPUTS_EVENTS_TYPES: rpc_coordinator = get_rpc_coordinator_by_device_id(hass, device_id) if rpc_coordinator and rpc_coordinator.device.initialized: - key = f"input:{channel-1}" + key = f"input:{channel - 1}" input_name = get_rpc_entity_name(rpc_coordinator.device, key) elif click_type in BLOCK_INPUTS_EVENTS_TYPES: diff --git a/homeassistant/components/shelly/utils.py b/homeassistant/components/shelly/utils.py index df374624e3d..d450727ead6 100644 --- a/homeassistant/components/shelly/utils.py +++ b/homeassistant/components/shelly/utils.py @@ -137,7 +137,7 @@ def get_block_channel_name(device: BlockDevice, block: Block | None) -> str: else: base = ord("1") - return f"{entity_name} channel {chr(int(block.channel)+base)}" + return f"{entity_name} channel {chr(int(block.channel) + base)}" def is_block_momentary_input( @@ -200,7 +200,7 @@ def get_block_input_triggers( subtype = "button" else: assert block.channel - subtype = f"button{int(block.channel)+1}" + subtype = f"button{int(block.channel) + 1}" if device.settings["device"]["type"] in SHBTN_MODELS: trigger_types = SHBTN_INPUTS_EVENTS_TYPES @@ -409,7 +409,7 @@ def get_rpc_input_triggers(device: RpcDevice) -> list[tuple[str, str]]: continue for trigger_type in RPC_INPUTS_EVENTS_TYPES: - subtype = f"button{id_+1}" + subtype = f"button{id_ + 1}" triggers.append((trigger_type, subtype)) return triggers diff --git a/homeassistant/components/slide_local/button.py b/homeassistant/components/slide_local/button.py index 795cd4f1c2e..faca7cb3f2b 100644 --- a/homeassistant/components/slide_local/button.py +++ b/homeassistant/components/slide_local/button.py @@ -44,7 +44,7 @@ class SlideButton(SlideEntity, ButtonEntity): def __init__(self, coordinator: SlideCoordinator) -> None: """Initialize the slide button.""" super().__init__(coordinator) - self._attr_unique_id = f"{coordinator.data["mac"]}-calibrate" + self._attr_unique_id = f"{coordinator.data['mac']}-calibrate" async def async_press(self) -> None: """Send out a calibrate command.""" diff --git a/homeassistant/components/slide_local/switch.py b/homeassistant/components/slide_local/switch.py index f1c33f9a76f..0471dfcc4e6 100644 --- a/homeassistant/components/slide_local/switch.py +++ b/homeassistant/components/slide_local/switch.py @@ -47,7 +47,7 @@ class SlideSwitch(SlideEntity, SwitchEntity): def __init__(self, coordinator: SlideCoordinator) -> None: """Initialize the slide switch.""" super().__init__(coordinator) - self._attr_unique_id = f"{coordinator.data["mac"]}-touchgo" + self._attr_unique_id = f"{coordinator.data['mac']}-touchgo" @property def is_on(self) -> bool: diff --git a/homeassistant/components/soma/cover.py b/homeassistant/components/soma/cover.py index 50f7d34e406..e64fee00f16 100644 --- a/homeassistant/components/soma/cover.py +++ b/homeassistant/components/soma/cover.py @@ -76,7 +76,7 @@ class SomaTilt(SomaEntity, CoverEntity): response = self.api.set_shade_position(self.device["mac"], 100) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while closing the cover ({self.name}): {response["msg"]}' + f"Error while closing the cover ({self.name}): {response['msg']}" ) self.set_position(0) @@ -85,7 +85,7 @@ class SomaTilt(SomaEntity, CoverEntity): response = self.api.set_shade_position(self.device["mac"], -100) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while opening the cover ({self.name}): {response["msg"]}' + f"Error while opening the cover ({self.name}): {response['msg']}" ) self.set_position(100) @@ -94,7 +94,7 @@ class SomaTilt(SomaEntity, CoverEntity): response = self.api.stop_shade(self.device["mac"]) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while stopping the cover ({self.name}): {response["msg"]}' + f"Error while stopping the cover ({self.name}): {response['msg']}" ) # Set cover position to some value where up/down are both enabled self.set_position(50) @@ -109,7 +109,7 @@ class SomaTilt(SomaEntity, CoverEntity): if not is_api_response_success(response): raise HomeAssistantError( f"Error while setting the cover position ({self.name}):" - f' {response["msg"]}' + f" {response['msg']}" ) self.set_position(kwargs[ATTR_TILT_POSITION]) @@ -152,7 +152,7 @@ class SomaShade(SomaEntity, CoverEntity): response = self.api.set_shade_position(self.device["mac"], 100) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while closing the cover ({self.name}): {response["msg"]}' + f"Error while closing the cover ({self.name}): {response['msg']}" ) def open_cover(self, **kwargs: Any) -> None: @@ -160,7 +160,7 @@ class SomaShade(SomaEntity, CoverEntity): response = self.api.set_shade_position(self.device["mac"], 0) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while opening the cover ({self.name}): {response["msg"]}' + f"Error while opening the cover ({self.name}): {response['msg']}" ) def stop_cover(self, **kwargs: Any) -> None: @@ -168,7 +168,7 @@ class SomaShade(SomaEntity, CoverEntity): response = self.api.stop_shade(self.device["mac"]) if not is_api_response_success(response): raise HomeAssistantError( - f'Error while stopping the cover ({self.name}): {response["msg"]}' + f"Error while stopping the cover ({self.name}): {response['msg']}" ) # Set cover position to some value where up/down are both enabled self.set_position(50) @@ -182,7 +182,7 @@ class SomaShade(SomaEntity, CoverEntity): if not is_api_response_success(response): raise HomeAssistantError( f"Error while setting the cover position ({self.name}):" - f' {response["msg"]}' + f" {response['msg']}" ) async def async_update(self) -> None: diff --git a/homeassistant/components/stream/core.py b/homeassistant/components/stream/core.py index 4184b23b9a0..b804055a740 100644 --- a/homeassistant/components/stream/core.py +++ b/homeassistant/components/stream/core.py @@ -166,7 +166,7 @@ class Segment: self.hls_playlist_parts.append( f"#EXT-X-PART:DURATION={part.duration:.3f},URI=" f'"./segment/{self.sequence}.{part_num}.m4s"' - f'{",INDEPENDENT=YES" if part.has_keyframe else ""}' + f"{',INDEPENDENT=YES' if part.has_keyframe else ''}" ) if self.complete: # Construct the final playlist_template. The placeholder will share a diff --git a/homeassistant/components/stream/worker.py b/homeassistant/components/stream/worker.py index 0c1f38938eb..c196e57baa4 100644 --- a/homeassistant/components/stream/worker.py +++ b/homeassistant/components/stream/worker.py @@ -460,7 +460,7 @@ class TimestampValidator: if packet.dts is None: if self._missing_dts >= MAX_MISSING_DTS: # type: ignore[unreachable] raise StreamWorkerError( - f"No dts in {MAX_MISSING_DTS+1} consecutive packets" + f"No dts in {MAX_MISSING_DTS + 1} consecutive packets" ) self._missing_dts += 1 return False diff --git a/homeassistant/components/surepetcare/binary_sensor.py b/homeassistant/components/surepetcare/binary_sensor.py index b422e40ef2d..3acd768cb30 100644 --- a/homeassistant/components/surepetcare/binary_sensor.py +++ b/homeassistant/components/surepetcare/binary_sensor.py @@ -135,8 +135,8 @@ class DeviceConnectivity(SurePetcareBinarySensor): self._attr_is_on = bool(state) if state: self._attr_extra_state_attributes = { - "device_rssi": f'{state["signal"]["device_rssi"]:.2f}', - "hub_rssi": f'{state["signal"]["hub_rssi"]:.2f}', + "device_rssi": f"{state['signal']['device_rssi']:.2f}", + "hub_rssi": f"{state['signal']['hub_rssi']:.2f}", } else: self._attr_extra_state_attributes = {} diff --git a/homeassistant/components/switchbee/__init__.py b/homeassistant/components/switchbee/__init__.py index 758698a7d67..b1a71665222 100644 --- a/homeassistant/components/switchbee/__init__.py +++ b/homeassistant/components/switchbee/__init__.py @@ -114,7 +114,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> if match := re.match( rf"(?:{old_unique_id})-(?P\d+)", entity_entry.unique_id ): - entity_new_unique_id = f'{new_unique_id}-{match.group("id")}' + entity_new_unique_id = f"{new_unique_id}-{match.group('id')}" _LOGGER.debug( "Migrating entity %s from %s to new id %s", entity_entry.entity_id, diff --git a/homeassistant/components/switchbot/config_flow.py b/homeassistant/components/switchbot/config_flow.py index fc2d9f491ac..31c0c42168d 100644 --- a/homeassistant/components/switchbot/config_flow.py +++ b/homeassistant/components/switchbot/config_flow.py @@ -67,7 +67,7 @@ def short_address(address: str) -> str: def name_from_discovery(discovery: SwitchBotAdvertisement) -> str: """Get the name from a discovery.""" - return f'{discovery.data["modelFriendlyName"]} {short_address(discovery.address)}' + return f"{discovery.data['modelFriendlyName']} {short_address(discovery.address)}" class SwitchbotConfigFlow(ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/tailwind/entity.py b/homeassistant/components/tailwind/entity.py index ec13dc7bd1f..dafb46e6f63 100644 --- a/homeassistant/components/tailwind/entity.py +++ b/homeassistant/components/tailwind/entity.py @@ -58,7 +58,7 @@ class TailwindDoorEntity(CoordinatorEntity[TailwindDataUpdateCoordinator]): self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, f"{coordinator.data.device_id}-{door_id}")}, via_device=(DOMAIN, coordinator.data.device_id), - name=f"Door {coordinator.data.doors[door_id].index+1}", + name=f"Door {coordinator.data.doors[door_id].index + 1}", manufacturer="Tailwind", model=coordinator.data.product, sw_version=coordinator.data.firmware_version, diff --git a/homeassistant/components/template/__init__.py b/homeassistant/components/template/__init__.py index 390a4a31bdb..7b7b5eb9b29 100644 --- a/homeassistant/components/template/__init__.py +++ b/homeassistant/components/template/__init__.py @@ -93,7 +93,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: continue if isinstance(entry.options[key], str): raise ConfigEntryError( - f"The '{entry.options.get(CONF_NAME) or ""}' number template needs to " + f"The '{entry.options.get(CONF_NAME) or ''}' number template needs to " f"be reconfigured, {key} must be a number, got '{entry.options[key]}'" ) diff --git a/homeassistant/components/twinkly/select.py b/homeassistant/components/twinkly/select.py index 2542d325b47..38e5c9a6fc7 100644 --- a/homeassistant/components/twinkly/select.py +++ b/homeassistant/components/twinkly/select.py @@ -35,7 +35,7 @@ class TwinklyModeSelect(TwinklyEntity, SelectEntity): def __init__(self, coordinator: TwinklyCoordinator) -> None: """Initialize TwinklyModeSelect.""" super().__init__(coordinator) - self._attr_unique_id = f"{coordinator.data.device_info["mac"]}_mode" + self._attr_unique_id = f"{coordinator.data.device_info['mac']}_mode" self.client = coordinator.client @property diff --git a/homeassistant/components/webhook/__init__.py b/homeassistant/components/webhook/__init__.py index 34e11f49978..01c4212d99e 100644 --- a/homeassistant/components/webhook/__init__.py +++ b/homeassistant/components/webhook/__init__.py @@ -97,14 +97,16 @@ def async_generate_url( ) -> str: """Generate the full URL for a webhook_id.""" return ( - f"{get_url( - hass, - allow_internal=allow_internal, - allow_external=allow_external, - allow_cloud=False, - allow_ip=allow_ip, - prefer_external=prefer_external, - )}" + f"{ + get_url( + hass, + allow_internal=allow_internal, + allow_external=allow_external, + allow_cloud=False, + allow_ip=allow_ip, + prefer_external=prefer_external, + ) + }" f"{async_generate_path(webhook_id)}" ) diff --git a/homeassistant/components/webostv/config_flow.py b/homeassistant/components/webostv/config_flow.py index 55dd45153f7..f3fbd3e0610 100644 --- a/homeassistant/components/webostv/config_flow.py +++ b/homeassistant/components/webostv/config_flow.py @@ -86,7 +86,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN): data = {CONF_HOST: self._host, CONF_CLIENT_SECRET: client.client_key} if not self._name: - self._name = f"{DEFAULT_NAME} {client.system_info["modelName"]}" + self._name = f"{DEFAULT_NAME} {client.system_info['modelName']}" return self.async_create_entry(title=self._name, data=data) return self.async_show_form(step_id="pairing", errors=errors) diff --git a/homeassistant/components/websocket_api/http.py b/homeassistant/components/websocket_api/http.py index e7d57aebab6..aa2e8b547c9 100644 --- a/homeassistant/components/websocket_api/http.py +++ b/homeassistant/components/websocket_api/http.py @@ -63,7 +63,7 @@ class WebSocketAdapter(logging.LoggerAdapter): def process(self, msg: str, kwargs: Any) -> tuple[str, Any]: """Add connid to websocket log messages.""" assert self.extra is not None - return f'[{self.extra["connid"]}] {msg}', kwargs + return f"[{self.extra['connid']}] {msg}", kwargs class WebSocketHandler: diff --git a/homeassistant/components/yale_smart_alarm/binary_sensor.py b/homeassistant/components/yale_smart_alarm/binary_sensor.py index 17b6035321a..fa9584505e2 100644 --- a/homeassistant/components/yale_smart_alarm/binary_sensor.py +++ b/homeassistant/components/yale_smart_alarm/binary_sensor.py @@ -86,7 +86,7 @@ class YaleDoorBatterySensor(YaleEntity, BinarySensorEntity): ) -> None: """Initiate Yale door battery Sensor.""" super().__init__(coordinator, data) - self._attr_unique_id = f"{data["address"]}-battery" + self._attr_unique_id = f"{data['address']}-battery" @property def is_on(self) -> bool: diff --git a/homeassistant/components/yale_smart_alarm/coordinator.py b/homeassistant/components/yale_smart_alarm/coordinator.py index 7ece2a3448b..db63567fa92 100644 --- a/homeassistant/components/yale_smart_alarm/coordinator.py +++ b/homeassistant/components/yale_smart_alarm/coordinator.py @@ -84,7 +84,7 @@ class YaleDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]): contact["address"]: contact["_state"] for contact in door_windows } _sensor_battery_map = { - f"{contact["address"]}-battery": contact["_battery"] + f"{contact['address']}-battery": contact["_battery"] for contact in door_windows } _temp_map = {temp["address"]: temp["status_temp"] for temp in temp_sensors} diff --git a/homeassistant/components/zha/update.py b/homeassistant/components/zha/update.py index cb5c160e7b3..5b813453a8b 100644 --- a/homeassistant/components/zha/update.py +++ b/homeassistant/components/zha/update.py @@ -163,11 +163,7 @@ class ZHAFirmwareUpdateEntity( """ if self.entity_data.device_proxy.device.is_mains_powered: - header = ( - "" - f"{OTA_MESSAGE_RELIABILITY}" - "" - ) + header = f"{OTA_MESSAGE_RELIABILITY}" else: header = ( ""