Improve type hints in heatmiser (#77592)

pull/77627/head
epenet 2022-08-31 22:18:39 +02:00 committed by GitHub
parent 152022aef3
commit c15faa161b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@
from __future__ import annotations
import logging
from typing import Any
from heatmiserV3 import connection, heatmiser
import voluptuous as vol
@ -100,9 +101,10 @@ class HeatmiserV3Thermostat(ClimateEntity):
"""Return the temperature we try to reach."""
return self._target_temperature
def set_temperature(self, **kwargs):
def set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temperature = kwargs.get(ATTR_TEMPERATURE)
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
return
self._target_temperature = int(temperature)
self.therm.set_target_temp(self._target_temperature)