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
@@ -154,18 +154,12 @@ class MagicSeaweedSensor(Entity):
|
||||
elif self.type == "max_breaking_swell":
|
||||
self._state = forecast.swell_maxBreakingHeight
|
||||
elif self.type == "swell_forecast":
|
||||
summary = "{} - {}".format(
|
||||
forecast.swell_minBreakingHeight, forecast.swell_maxBreakingHeight
|
||||
)
|
||||
summary = f"{forecast.swell_minBreakingHeight} - {forecast.swell_maxBreakingHeight}"
|
||||
self._state = summary
|
||||
if self.hour is None:
|
||||
for hour, data in self.data.hourly.items():
|
||||
occurs = hour
|
||||
hr_summary = "{} - {} {}".format(
|
||||
data.swell_minBreakingHeight,
|
||||
data.swell_maxBreakingHeight,
|
||||
data.swell_unit,
|
||||
)
|
||||
hr_summary = f"{data.swell_minBreakingHeight} - {data.swell_maxBreakingHeight} {data.swell_unit}"
|
||||
self._attrs[occurs] = hr_summary
|
||||
|
||||
if self.type != "swell_forecast":
|
||||
|
||||
Reference in new issue
Block a user