From af80b9d3bd639f350ad1fbfd392128541e9b59b9 Mon Sep 17 00:00:00 2001 From: Marc-Olivier Arsenault Date: Sat, 13 Jan 2024 01:32:22 +0000 Subject: [PATCH] add test --- tests/test_sensor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_sensor.py b/tests/test_sensor.py index 33e1221..e6935e7 100755 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -209,6 +209,18 @@ async def test_opt_sensor_missing(hass, get_data, get_printer_objects_list): assert state is None +async def test_missing_heater_bed(hass, get_data): + """test.""" + get_data["status"]["heater_bed"]["target"] = None + + config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id="test") + config_entry.add_to_hass(hass) + assert await async_setup_entry(hass, config_entry) + await hass.async_block_till_done() + + assert hass.states.get("sensor.mainsail_bed_target").state == "0.0" + + async def test_eta(hass): """test.""" config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id="test")