Fix issue probably-meant-fstring found at https://codereview.doctor (#70574)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
8eae572c93
commit
304426edb1
5 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ def setup_platform(
|
|||
_LOGGER.error("%s", ex)
|
||||
persistent_notification.create(
|
||||
hass,
|
||||
"Error: {ex}<br />You will need to restart hass after fixing.",
|
||||
f"Error: {ex}<br />You will need to restart hass after fixing.",
|
||||
title=NOTIFICATION_TITLE,
|
||||
notification_id=NOTIFICATION_ID,
|
||||
)
|
||||
|
|
|
@ -254,7 +254,7 @@ class AsyncDemoPercentageFan(BaseDemoFan, FanEntity):
|
|||
"""Set new preset mode."""
|
||||
if self.preset_modes is None or preset_mode not in self.preset_modes:
|
||||
raise ValueError(
|
||||
"{preset_mode} is not a valid preset_mode: {self.preset_modes}"
|
||||
f"{preset_mode} is not a valid preset_mode: {self.preset_modes}"
|
||||
)
|
||||
self._preset_mode = preset_mode
|
||||
self._percentage = None
|
||||
|
|
|
@ -65,7 +65,7 @@ class EzvizSwitch(EzvizEntity, SwitchEntity):
|
|||
)
|
||||
|
||||
except (HTTPError, PyEzvizError) as err:
|
||||
raise PyEzvizError("Failed to turn on switch {self._name}") from err
|
||||
raise PyEzvizError(f"Failed to turn on switch {self._name}") from err
|
||||
|
||||
if update_ok:
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
|
|
@ -71,7 +71,7 @@ def browse_media( # noqa: C901
|
|||
try:
|
||||
media_class = ITEM_TYPE_MEDIA_CLASS[item.type]
|
||||
except KeyError as err:
|
||||
raise UnknownMediaType("Unknown type received: {item.type}") from err
|
||||
raise UnknownMediaType(f"Unknown type received: {item.type}") from err
|
||||
payload = {
|
||||
"title": pretty_title(item, short_name),
|
||||
"media_class": media_class,
|
||||
|
|
|
@ -81,7 +81,7 @@ class ConnectXiaomiGateway:
|
|||
raise AuthException(error) from error
|
||||
|
||||
raise SetupException(
|
||||
"DeviceException during setup of xiaomi gateway with host {self._host}"
|
||||
f"DeviceException during setup of xiaomi gateway with host {self._host}"
|
||||
) from error
|
||||
|
||||
# get the connected sub devices
|
||||
|
@ -115,7 +115,7 @@ class ConnectXiaomiGateway:
|
|||
if not miio_cloud.login():
|
||||
raise SetupException(
|
||||
"Failed to login to Xiaomi Miio Cloud during setup of Xiaomi"
|
||||
" gateway with host {self._host}",
|
||||
f" gateway with host {self._host}",
|
||||
)
|
||||
devices_raw = miio_cloud.get_devices(self._cloud_country)
|
||||
self._gateway_device.get_devices_from_dict(devices_raw)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue