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
@@ -127,7 +127,7 @@ class MoparData:
|
||||
vehicle = self.vehicles[index]
|
||||
if not vehicle:
|
||||
return None
|
||||
return "{} {} {}".format(vehicle["year"], vehicle["make"], vehicle["model"])
|
||||
return f"{vehicle['year']} {vehicle['make']} {vehicle['model']}"
|
||||
|
||||
def actuate(self, command, index):
|
||||
"""Run a command on the specified Mopar vehicle."""
|
||||
|
||||
@@ -22,7 +22,7 @@ class MoparLock(LockDevice):
|
||||
def __init__(self, data, index):
|
||||
"""Initialize the Mopar lock."""
|
||||
self._index = index
|
||||
self._name = "{} Lock".format(data.get_vehicle_name(self._index))
|
||||
self._name = f"{data.get_vehicle_name(self._index)} Lock"
|
||||
self._actuate = data.actuate
|
||||
self._state = None
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class MoparSwitch(SwitchDevice):
|
||||
def __init__(self, data, index):
|
||||
"""Initialize the Switch."""
|
||||
self._index = index
|
||||
self._name = "{} Switch".format(data.get_vehicle_name(self._index))
|
||||
self._name = f"{data.get_vehicle_name(self._index)} Switch"
|
||||
self._actuate = data.actuate
|
||||
self._state = None
|
||||
|
||||
|
||||
Reference in new issue
Block a user