mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Fix temperature stepping in Sensibo (#67737)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
48e6738367
commit
7041bc797a
@ -17,6 +17,8 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, Upda
|
|||||||
|
|
||||||
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER, TIMEOUT
|
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER, TIMEOUT
|
||||||
|
|
||||||
|
MAX_POSSIBLE_STEP = 1000
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MotionSensor:
|
class MotionSensor:
|
||||||
@ -93,7 +95,11 @@ class SensiboDataUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
.get("values", [0, 1])
|
.get("values", [0, 1])
|
||||||
)
|
)
|
||||||
if temperatures_list:
|
if temperatures_list:
|
||||||
temperature_step = temperatures_list[1] - temperatures_list[0]
|
diff = MAX_POSSIBLE_STEP
|
||||||
|
for i in range(len(temperatures_list) - 1):
|
||||||
|
if temperatures_list[i + 1] - temperatures_list[i] < diff:
|
||||||
|
diff = temperatures_list[i + 1] - temperatures_list[i]
|
||||||
|
temperature_step = diff
|
||||||
|
|
||||||
active_features = list(ac_states)
|
active_features = list(ac_states)
|
||||||
full_features = set()
|
full_features = set()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user