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
@@ -675,7 +675,7 @@ class MqttLight(
|
||||
{"red": rgb[0], "green": rgb[1], "blue": rgb[2]}
|
||||
)
|
||||
else:
|
||||
rgb_color_str = "{},{},{}".format(*rgb)
|
||||
rgb_color_str = f"{rgb[0]},{rgb[1]},{rgb[2]}"
|
||||
|
||||
mqtt.async_publish(
|
||||
self.hass,
|
||||
@@ -695,7 +695,7 @@ class MqttLight(
|
||||
mqtt.async_publish(
|
||||
self.hass,
|
||||
self._topic[CONF_HS_COMMAND_TOPIC],
|
||||
"{},{}".format(*hs_color),
|
||||
f"{hs_color[0]},{hs_color[1]}",
|
||||
self._config[CONF_QOS],
|
||||
self._config[CONF_RETAIN],
|
||||
)
|
||||
@@ -710,7 +710,7 @@ class MqttLight(
|
||||
mqtt.async_publish(
|
||||
self.hass,
|
||||
self._topic[CONF_XY_COMMAND_TOPIC],
|
||||
"{},{}".format(*xy_color),
|
||||
f"{xy_color[0]},{xy_color[1]}",
|
||||
self._config[CONF_QOS],
|
||||
self._config[CONF_RETAIN],
|
||||
)
|
||||
@@ -753,7 +753,7 @@ class MqttLight(
|
||||
{"red": rgb[0], "green": rgb[1], "blue": rgb[2]}
|
||||
)
|
||||
else:
|
||||
rgb_color_str = "{},{},{}".format(*rgb)
|
||||
rgb_color_str = f"{rgb[0]},{rgb[1]},{rgb[2]}"
|
||||
|
||||
mqtt.async_publish(
|
||||
self.hass,
|
||||
|
||||
Reference in new issue
Block a user