Skip to content

Commit 6a739e6

Browse files
committed
simplify and fix
1 parent 39d7510 commit 6a739e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyfritzhome/fritzhome.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,19 +292,19 @@ def get_temperature(self, ain):
292292

293293
def _get_temperature(self, ain, name):
294294
plain = self._aha_request(name, ain=ain, rf=float)
295-
return (plain - 16) / 2 + 8
295+
return plain / 2
296296

297297
def get_target_temperature(self, ain):
298298
"""Get the thermostate target temperature."""
299299
return self._get_temperature(ain, "gethkrtsoll")
300300

301301
def set_target_temperature(self, ain, temperature, wait=False):
302302
"""Set the thermostate target temperature."""
303-
temp = int(16 + ((float(temperature) - 8) * 2))
303+
temp = int(temperature * 2)
304304

305-
if temp < min(range(16, 56)):
305+
if temp < 16:
306306
temp = 253
307-
elif temp > max(range(16, 56)):
307+
elif temp > 56:
308308
temp = 254
309309

310310
self._aha_request("sethkrtsoll", ain=ain, param={"param": temp})

0 commit comments

Comments
 (0)