String formatting and max line length - Part 2 (#84393)

This commit is contained in:
Franck Nijhof 2022-12-22 11:38:59 +01:00 committed by GitHub
parent 7e682af472
commit cb13418bab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 431 additions and 174 deletions

View file

@ -667,7 +667,9 @@ def _async_get_matching_entities(
"""Fetch all entities or entities in the given domains."""
ent_reg = entity_registry.async_get(hass)
return {
state.entity_id: f"{state.attributes.get(ATTR_FRIENDLY_NAME, state.entity_id)} ({state.entity_id})"
state.entity_id: (
f"{state.attributes.get(ATTR_FRIENDLY_NAME, state.entity_id)} ({state.entity_id})"
)
for state in sorted(
hass.states.async_all(domains and set(domains)),
key=lambda item: item.entity_id,