Remove steam temp sensor for Linea Mini (#119423)

This commit is contained in:
Josef Zweck 2024-06-12 23:35:51 +02:00 committed by GitHub
parent fd83b9a7c6
commit 4e121fcbe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -3,7 +3,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from lmcloud.const import BoilerType, PhysicalKey
from lmcloud.const import BoilerType, MachineModel, PhysicalKey
from lmcloud.lm_machine import LaMarzoccoMachine
from homeassistant.components.sensor import (
@ -80,6 +80,8 @@ ENTITIES: tuple[LaMarzoccoSensorEntityDescription, ...] = (
value_fn=lambda device: device.config.boilers[
BoilerType.STEAM
].current_temperature,
supported_fn=lambda coordinator: coordinator.device.model
!= MachineModel.LINEA_MINI,
),
)

View File

@ -2,6 +2,7 @@
from unittest.mock import MagicMock
from lmcloud.const import MachineModel
import pytest
from syrupy import SnapshotAssertion
@ -71,3 +72,17 @@ async def test_shot_timer_unavailable(
state = hass.states.get(f"sensor.{mock_lamarzocco.serial_number}_shot_timer")
assert state
assert state.state == STATE_UNAVAILABLE
@pytest.mark.parametrize("device_fixture", [MachineModel.LINEA_MINI])
async def test_no_steam_linea_mini(
hass: HomeAssistant,
mock_lamarzocco: MagicMock,
mock_config_entry: MockConfigEntry,
) -> None:
"""Ensure Linea Mini has no steam temp."""
await async_init_integration(hass, mock_config_entry)
serial_number = mock_lamarzocco.serial_number
state = hass.states.get(f"sensor.{serial_number}_current_temp_steam")
assert state is None