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
@@ -328,7 +328,7 @@ class AllStates:
|
||||
if not valid_entity_id(name):
|
||||
raise TemplateError(f"Invalid entity ID '{name}'")
|
||||
return _get_state(self._hass, name)
|
||||
if not valid_entity_id(name + ".entity"):
|
||||
if not valid_entity_id(f"{name}.entity"):
|
||||
raise TemplateError(f"Invalid domain name '{name}'")
|
||||
return DomainStates(self._hass, name)
|
||||
|
||||
@@ -451,7 +451,7 @@ class TemplateState(State):
|
||||
"""Representation of Template State."""
|
||||
state = object.__getattribute__(self, "_access_state")()
|
||||
rep = state.__repr__()
|
||||
return "<template " + rep[1:]
|
||||
return f"<template {rep[1:]}"
|
||||
|
||||
|
||||
def _collect_state(hass, entity_id):
|
||||
|
||||
Reference in new issue
Block a user