mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
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:
committed by
Andrew Sayre
parent
3534b8a977
commit
ad51615718
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user