mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
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
@ -58,7 +58,7 @@ def setup_platform(
|
|||||||
_LOGGER.error("%s", ex)
|
_LOGGER.error("%s", ex)
|
||||||
persistent_notification.create(
|
persistent_notification.create(
|
||||||
hass,
|
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,
|
title=NOTIFICATION_TITLE,
|
||||||
notification_id=NOTIFICATION_ID,
|
notification_id=NOTIFICATION_ID,
|
||||||
)
|
)
|
||||||
|
@ -254,7 +254,7 @@ class AsyncDemoPercentageFan(BaseDemoFan, FanEntity):
|
|||||||
"""Set new preset mode."""
|
"""Set new preset mode."""
|
||||||
if self.preset_modes is None or preset_mode not in self.preset_modes:
|
if self.preset_modes is None or preset_mode not in self.preset_modes:
|
||||||
raise ValueError(
|
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._preset_mode = preset_mode
|
||||||
self._percentage = None
|
self._percentage = None
|
||||||
|
@ -65,7 +65,7 @@ class EzvizSwitch(EzvizEntity, SwitchEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
except (HTTPError, PyEzvizError) as err:
|
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:
|
if update_ok:
|
||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
@ -71,7 +71,7 @@ def browse_media( # noqa: C901
|
|||||||
try:
|
try:
|
||||||
media_class = ITEM_TYPE_MEDIA_CLASS[item.type]
|
media_class = ITEM_TYPE_MEDIA_CLASS[item.type]
|
||||||
except KeyError as err:
|
except KeyError as err:
|
||||||
raise UnknownMediaType("Unknown type received: {item.type}") from err
|
raise UnknownMediaType(f"Unknown type received: {item.type}") from err
|
||||||
payload = {
|
payload = {
|
||||||
"title": pretty_title(item, short_name),
|
"title": pretty_title(item, short_name),
|
||||||
"media_class": media_class,
|
"media_class": media_class,
|
||||||
|
@ -81,7 +81,7 @@ class ConnectXiaomiGateway:
|
|||||||
raise AuthException(error) from error
|
raise AuthException(error) from error
|
||||||
|
|
||||||
raise SetupException(
|
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
|
) from error
|
||||||
|
|
||||||
# get the connected sub devices
|
# get the connected sub devices
|
||||||
@ -115,7 +115,7 @@ class ConnectXiaomiGateway:
|
|||||||
if not miio_cloud.login():
|
if not miio_cloud.login():
|
||||||
raise SetupException(
|
raise SetupException(
|
||||||
"Failed to login to Xiaomi Miio Cloud during setup of Xiaomi"
|
"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)
|
devices_raw = miio_cloud.get_devices(self._cloud_country)
|
||||||
self._gateway_device.get_devices_from_dict(devices_raw)
|
self._gateway_device.get_devices_from_dict(devices_raw)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user