Use f-strings in integrations starting with "M" (#32271)
* Use f-strings in integrations starting with "M" * Format mqtt light init with black * Fix lint error * Fix pylint error * Restore constants * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Update homeassistant/components/mqtt/discovery.py * Format with Black
This commit is contained in:
1 parent
bbe0f75336
commit
ba0aaeeddb
34 files changed
+62
-80
No files matched your search
@@ -93,7 +93,7 @@ async def async_setup_entry(hass, entry):
|
||||
|
||||
hass.data[DOMAIN][DATA_DEVICES][webhook_id] = device
|
||||
|
||||
registration_name = "Mobile App: {}".format(registration[ATTR_DEVICE_NAME])
|
||||
registration_name = f"Mobile App: {registration[ATTR_DEVICE_NAME]}"
|
||||
webhook_register(hass, DOMAIN, registration_name, webhook_id, handle_webhook)
|
||||
|
||||
for domain in PLATFORMS:
|
||||
|
||||
@@ -139,8 +139,8 @@ class MobileAppNotificationService(BaseNotificationService):
|
||||
continue
|
||||
|
||||
fallback_error = result.get("errorMessage", "Unknown error")
|
||||
fallback_message = "Internal server error, please try again later: {}".format(
|
||||
fallback_error
|
||||
fallback_message = (
|
||||
f"Internal server error, please try again later: {fallback_error}"
|
||||
)
|
||||
message = result.get("message", fallback_message)
|
||||
if response.status == 429:
|
||||
|
||||
@@ -381,7 +381,7 @@ async def webhook_register_sensor(hass, config_entry, data):
|
||||
_LOGGER.error("Error registering sensor: %s", ex)
|
||||
return empty_okay_response()
|
||||
|
||||
register_signal = "{}_{}_register".format(DOMAIN, data[ATTR_SENSOR_TYPE])
|
||||
register_signal = f"{DOMAIN}_{data[ATTR_SENSOR_TYPE]}_register"
|
||||
async_dispatcher_send(hass, register_signal, data)
|
||||
|
||||
return webhook_response(
|
||||
|
||||
Reference in new issue
Block a user