Use f-strings in integrations starting with "A" (#32110)

* Use f-strings in integrations starting with A

* Use f-strings in tests for integrations starting with A

* Fix pylint by renaming variable

* Fix nested for loop in f-string for aprs device_tracker

* Break long lines into multiple short lines

* Break long lines into multiple short lines v2
This commit is contained in:
springstan authored and GitHub committed 2020-02-23 13:38:05 -08:00
1 parent a85808e325
commit 524a1a7587
48 files changed
+162 -229

No files matched your search

+1 -2
View File
@@ -26,7 +26,6 @@ from homeassistant.const import (
URL_API_EVENTS,
URL_API_SERVICES,
URL_API_STATES,
URL_API_STATES_ENTITY,
URL_API_STREAM,
URL_API_TEMPLATE,
__version__,
@@ -254,7 +253,7 @@ class APIEntityStateView(HomeAssistantView):
status_code = HTTP_CREATED if is_new_state else 200
resp = self.json(hass.states.get(entity_id), status_code)
resp.headers.add("Location", URL_API_STATES_ENTITY.format(entity_id))
resp.headers.add("Location", f"/api/states/{entity_id}")
return resp