String formatting cleanups (#52937)

This commit is contained in:
Ville Skyttä 2021-07-13 01:12:55 +03:00 committed by GitHub
parent 2970931d8d
commit 9864f2ef8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 32 additions and 35 deletions

View file

@ -41,7 +41,7 @@ def get_location_from_entity(hass, logger, entity_id):
return get_location_from_attributes(entity)
# Check if device is in a zone
zone_entity = hass.states.get("zone.%s" % entity.state)
zone_entity = hass.states.get(f"zone.{entity.state}")
if location.has_location(zone_entity):
logger.debug(
"%s is in %s, getting zone location", entity_id, zone_entity.entity_id