|
9 | 9 | from syrupy.assertion import SnapshotAssertion |
10 | 10 |
|
11 | 11 | from homeassistant.components.climate import ( |
| 12 | + ATTR_CURRENT_TEMPERATURE, |
12 | 13 | ATTR_HVAC_ACTION, |
13 | 14 | ATTR_HVAC_MODE, |
14 | 15 | ATTR_HVAC_MODES, |
|
24 | 25 | HVACMode, |
25 | 26 | ) |
26 | 27 | from homeassistant.components.plugwise.climate import PlugwiseClimateExtraStoredData |
27 | | -from homeassistant.const import ATTR_ENTITY_ID, ATTR_TEMPERATURE, STATE_OFF, STATE_ON |
| 28 | +from homeassistant.const import ( |
| 29 | + ATTR_ENTITY_ID, |
| 30 | + ATTR_TEMPERATURE, |
| 31 | + STATE_OFF, |
| 32 | + STATE_ON, |
| 33 | + STATE_UNAVAILABLE, |
| 34 | +) |
28 | 35 | from homeassistant.core import HomeAssistant, State |
29 | 36 | from homeassistant.exceptions import HomeAssistantError, ServiceValidationError |
30 | 37 | from homeassistant.helpers import entity_registry as er |
@@ -680,3 +687,22 @@ async def test_anna_p1_climate_snapshot( |
680 | 687 | ) -> None: |
681 | 688 | """Test Anna P1 climate snapshot.""" |
682 | 689 | await snapshot_platform(hass, entity_registry, snapshot, setup_platform.entry_id) |
| 690 | + |
| 691 | + |
| 692 | +@pytest.mark.parametrize("chosen_env", ["m_adam_cooling"], indirect=True) |
| 693 | +@pytest.mark.parametrize("cooling_present", [False], indirect=True) |
| 694 | +async def test_tom_without_temperature_measurement( |
| 695 | + hass: HomeAssistant, |
| 696 | + mock_config_entry: MockConfigEntry, |
| 697 | + mock_smile_adam_heat_cool: MagicMock, |
| 698 | +) -> None: |
| 699 | + """Test Tom without temperature measurement.""" |
| 700 | + data = mock_smile_adam_heat_cool.async_update.return_value |
| 701 | + del data["f871b8c4d63549319221e294e4f88074"]["sensors"]["temperature"] |
| 702 | + mock_config_entry.add_to_hass(hass) |
| 703 | + await hass.config_entries.async_setup(mock_config_entry.entry_id) |
| 704 | + await hass.async_block_till_done() |
| 705 | + |
| 706 | + assert (state := hass.states.get("climate.bathroom")) is not None |
| 707 | + assert state.state != STATE_UNAVAILABLE |
| 708 | + assert state.attributes[ATTR_CURRENT_TEMPERATURE] is None |
0 commit comments