Use literal string interpolation in integrations A (f-strings) (#26377)

* Use literal string interpolation in integrations A (f-strings)

* Black
This commit is contained in:
Franck Nijhof
2019-09-03 16:11:36 +02:00
committed by Andrew Sayre
parent 3534b8a977
commit ad51615718
37 changed files with 74 additions and 95 deletions

View File

@@ -73,9 +73,7 @@ class ArestBinarySensor(BinarySensorDevice):
self._pin = pin
if self._pin is not None:
request = requests.get(
"{}/mode/{}/i".format(self._resource, self._pin), timeout=10
)
request = requests.get(f"{self._resource}/mode/{self._pin}/i", timeout=10)
if request.status_code != 200:
_LOGGER.error("Can't set mode of %s", self._resource)
@@ -112,9 +110,7 @@ class ArestData:
def update(self):
"""Get the latest data from aREST device."""
try:
response = requests.get(
"{}/digital/{}".format(self._resource, self._pin), timeout=10
)
response = requests.get(f"{self._resource}/digital/{self._pin}", timeout=10)
self.data = {"state": response.json()["return_value"]}
except requests.exceptions.ConnectionError:
_LOGGER.error("No route to device '%s'", self._resource)