Fix Duco state end time being rounded by the integration (#175124)

This commit is contained in:
Ronald van der Meer
2026-06-30 15:47:06 +02:00
committed by GitHub
parent 7950469e31
commit 8cb101ae85
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -83,9 +83,7 @@ SENSOR_DESCRIPTIONS: tuple[DucoSensorEntityDescription, ...] = (
translation_key="time_state_end",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=lambda node: (
dt_util.utc_from_timestamp(node.ventilation.time_state_end).replace(
second=0, microsecond=0
)
dt_util.utc_from_timestamp(node.ventilation.time_state_end)
if node.ventilation and node.ventilation.time_state_end != 0
else None
),
+2 -2
View File
@@ -59,7 +59,7 @@ async def test_ventilation_related_sensors_created_for_supported_node_types(
ventilation=replace(
mock_sensor_nodes[0].ventilation,
flow_lvl_tgt=42,
time_state_end=1700000400,
time_state_end=1700000459,
),
)
mock_duco_client.async_get_nodes.return_value = [
@@ -79,7 +79,7 @@ async def test_ventilation_related_sensors_created_for_supported_node_types(
state = hass.states.get("sensor.living_state_end_time")
assert state is not None
assert state.state == "2023-11-14T22:20:00+00:00"
assert state.state == "2023-11-14T22:20:59+00:00"
assert hass.states.get("sensor.office_co2_ventilation_state") is None
assert hass.states.get("sensor.office_co2_target_flow_level") is None