mirror of
https://github.com/home-assistant/core.git
synced 2026-08-31 10:34:00 +01:00
Fix Duco state end time being rounded by the integration (#175124)
This commit is contained in:
@@ -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
|
||||
),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user