Skip to content

Commit

Permalink
Remove steam temp sensor for Linea Mini (home-assistant#119423)
Browse files Browse the repository at this point in the history
  • Loading branch information
zweckj authored Jun 12, 2024
1 parent fd83b9a commit 4e121fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/components/lamarzocco/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -80,6 +80,8 @@ class LaMarzoccoSensorEntityDescription(
value_fn=lambda device: device.config.boilers[
BoilerType.STEAM
].current_temperature,
supported_fn=lambda coordinator: coordinator.device.model
!= MachineModel.LINEA_MINI,
),
)

Expand Down
15 changes: 15 additions & 0 deletions tests/components/lamarzocco/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from unittest.mock import MagicMock

from lmcloud.const import MachineModel
import pytest
from syrupy import SnapshotAssertion

Expand Down Expand Up @@ -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

0 comments on commit 4e121fc

Please sign in to comment.