Skip to content

Commit

Permalink
Add tests to myuplink binary_sensor (#110995)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrandb authored Feb 21, 2024
1 parent 05b23c2 commit 2614d6f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,6 @@ omit =
homeassistant/components/myuplink/__init__.py
homeassistant/components/myuplink/api.py
homeassistant/components/myuplink/application_credentials.py
homeassistant/components/myuplink/binary_sensor.py
homeassistant/components/myuplink/coordinator.py
homeassistant/components/myuplink/entity.py
homeassistant/components/myuplink/helpers.py
Expand Down
25 changes: 25 additions & 0 deletions tests/components/myuplink/test_binary_sensor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Tests for myuplink sensor module."""

from unittest.mock import MagicMock

from homeassistant.core import HomeAssistant

from . import setup_integration

from tests.common import MockConfigEntry


async def test_sensor_states(
hass: HomeAssistant,
mock_myuplink_client: MagicMock,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test sensor state."""
await setup_integration(hass, mock_config_entry)

state = hass.states.get("binary_sensor.f730_cu_3x400v_pump_heating_medium_gp1")
assert state is not None
assert state.state == "on"
assert state.attributes == {
"friendly_name": "F730 CU 3x400V Pump: Heating medium (GP1)",
}

0 comments on commit 2614d6f

Please sign in to comment.