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:
parent
5ad209c6fd
commit
fa4fa30461
105 changed files with 241 additions and 314 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue