@@ -53,7 +53,7 @@ def getLoginToken(self):
53
53
return token
54
54
else :
55
55
_LOGGER .error (
56
- "Something went wrong fetching token: {0 }" .format (
56
+ "Something went wrong fetching token: {}" .format (
57
57
request_token_result .status_code
58
58
)
59
59
)
@@ -74,7 +74,7 @@ def loadData(self):
74
74
75
75
def loadSmartHomes (self , firstTry : bool = True ):
76
76
"""Load the user data"""
77
- headers = {"Authorization" : "Bearer {}" . format ( self ._token ) }
77
+ headers = {"Authorization" : f "Bearer { self ._token } " }
78
78
payload = {"token" : "true" , "email" : self ._username , "lang" : "nl_NL" }
79
79
80
80
user_data_result = requests .post (
@@ -97,7 +97,7 @@ def loadSmartHomes(self, firstTry: bool = True):
97
97
return self .loadSmartHomes (firstTry = False )
98
98
else :
99
99
_LOGGER .error (
100
- "Something went wrong fetching user data. Code: {0 }, Key: {1 }, Value: {2 }, Data: {3 }" .format (
100
+ "Something went wrong fetching user data. Code: {}, Key: {}, Value: {}, Data: {}" .format (
101
101
user_data_result .json ()["code" ]["code" ],
102
102
user_data_result .json ()["code" ]["key" ],
103
103
user_data_result .json ()["code" ]["value" ],
@@ -107,7 +107,7 @@ def loadSmartHomes(self, firstTry: bool = True):
107
107
return None
108
108
else :
109
109
_LOGGER .error (
110
- "Something went wrong fetching user data: {0 }" .format (
110
+ "Something went wrong fetching user data: {}" .format (
111
111
user_data_result .status_code
112
112
)
113
113
)
@@ -116,7 +116,7 @@ def loadSmartHomes(self, firstTry: bool = True):
116
116
def loadDevices (self , smarthome : str , firstTry : bool = True ):
117
117
"""Load devices for smart home"""
118
118
119
- headers = {"Authorization" : "Bearer {}" . format ( self ._token ) }
119
+ headers = {"Authorization" : f "Bearer { self ._token } " }
120
120
payload = {"token" : "true" , "smarthome_id" : smarthome , "lang" : "nl_NL" }
121
121
122
122
devices_result = requests .post (
@@ -139,7 +139,7 @@ def loadDevices(self, smarthome: str, firstTry: bool = True):
139
139
return self .loadDevices (smarthome , firstTry = False )
140
140
else :
141
141
_LOGGER .error (
142
- "Something went wrong fetching user data. Code: {0 }, Key: {1 }, Value: {2 }, Data: {3 }" .format (
142
+ "Something went wrong fetching user data. Code: {}, Key: {}, Value: {}, Data: {}" .format (
143
143
devices_result .json ()["code" ]["code" ],
144
144
devices_result .json ()["code" ]["key" ],
145
145
devices_result .json ()["code" ]["value" ],
@@ -149,7 +149,7 @@ def loadDevices(self, smarthome: str, firstTry: bool = True):
149
149
return None
150
150
else :
151
151
_LOGGER .error (
152
- "Something went wrong fetching devices: {0 }" .format (
152
+ "Something went wrong fetching devices: {}" .format (
153
153
devices_result .status_code
154
154
)
155
155
)
@@ -186,7 +186,7 @@ def pushTemperature(
186
186
gvMode : str ,
187
187
firstTry : bool = True ,
188
188
):
189
- headers = {"Authorization" : "Bearer {}" . format ( self ._token ) }
189
+ headers = {"Authorization" : f "Bearer { self ._token } " }
190
190
payload = {}
191
191
if gvMode == "0" :
192
192
payload = {
@@ -292,7 +292,7 @@ def pushTemperature(
292
292
)
293
293
else :
294
294
_LOGGER .error (
295
- "Something went wrong updating the device. Code: {0 }, Key: {1 }, Value: {2 }, Data: {3 }" .format (
295
+ "Something went wrong updating the device. Code: {}, Key: {}, Value: {}, Data: {}" .format (
296
296
push_result .json ()["code" ]["code" ],
297
297
push_result .json ()["code" ]["key" ],
298
298
push_result .json ()["code" ]["value" ],
@@ -302,14 +302,14 @@ def pushTemperature(
302
302
return False
303
303
else :
304
304
_LOGGER .error (
305
- "Something went wrong updating the device: {0 }" .format (
305
+ "Something went wrong updating the device: {}" .format (
306
306
push_result .status_code
307
307
)
308
308
)
309
309
return False
310
310
311
311
def getLastCommunication (self , smarthome : str , firstTry : bool = True ):
312
- headers = {"Authorization" : "Bearer {}" . format ( self ._token ) }
312
+ headers = {"Authorization" : f "Bearer { self ._token } " }
313
313
payload = {
314
314
"token" : "true" ,
315
315
"smarthome_id" : smarthome ,
@@ -336,7 +336,7 @@ def getLastCommunication(self, smarthome: str, firstTry: bool = True):
336
336
return self .getLastCommunication (smarthome , firstTry = False )
337
337
else :
338
338
_LOGGER .error (
339
- "Something went wrong fetching user data. Code: {0 }, Key: {1 }, Value: {2 }, Data: {3 }" .format (
339
+ "Something went wrong fetching user data. Code: {}, Key: {}, Value: {}, Data: {}" .format (
340
340
last_connection_result .json ()["code" ]["code" ],
341
341
last_connection_result .json ()["code" ]["key" ],
342
342
last_connection_result .json ()["code" ]["value" ],
@@ -346,7 +346,7 @@ def getLastCommunication(self, smarthome: str, firstTry: bool = True):
346
346
return None
347
347
else :
348
348
_LOGGER .error (
349
- "Something went wrong fetching devices: {0 }" .format (
349
+ "Something went wrong fetching devices: {}" .format (
350
350
last_connection_result .status_code
351
351
)
352
352
)
0 commit comments