Various string cleanups (#30435)
* Remove some unnecessary string concatenations * Replace some simple str.formats with f-strings * Replace some string concatenations with f-strings
This commit is contained in:
1 parent
5ad209c6fd
commit
fa4fa30461
105 files changed
+241
-314
No files matched your search
@@ -127,7 +127,7 @@ class I2CHatSwitch(ToggleEntity):
|
||||
state = self.I2C_HATS_MANAGER.read_dq(self._address, self._channel)
|
||||
return state != self._invert_logic
|
||||
except I2CHatsException as ex:
|
||||
_LOGGER.error(self._log_message("Is ON check failed, " + str(ex)))
|
||||
_LOGGER.error(self._log_message(f"Is ON check failed, {ex!s}"))
|
||||
return False
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
@@ -137,7 +137,7 @@ class I2CHatSwitch(ToggleEntity):
|
||||
self.I2C_HATS_MANAGER.write_dq(self._address, self._channel, state)
|
||||
self.schedule_update_ha_state()
|
||||
except I2CHatsException as ex:
|
||||
_LOGGER.error(self._log_message("Turn ON failed, " + str(ex)))
|
||||
_LOGGER.error(self._log_message(f"Turn ON failed, {ex!s}"))
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
"""Turn the device off."""
|
||||
@@ -146,4 +146,4 @@ class I2CHatSwitch(ToggleEntity):
|
||||
self.I2C_HATS_MANAGER.write_dq(self._address, self._channel, state)
|
||||
self.schedule_update_ha_state()
|
||||
except I2CHatsException as ex:
|
||||
_LOGGER.error(self._log_message("Turn OFF failed:, " + str(ex)))
|
||||
_LOGGER.error(self._log_message(f"Turn OFF failed, {ex!s}"))
|
||||
Reference in new issue
Block a user