mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Add tests to myuplink binary_sensor (#110995)
This commit is contained in:
parent
05b23c2e7b
commit
2614d6fece
@ -1708,7 +1708,6 @@ omit =
|
|||||||
homeassistant/components/myuplink/__init__.py
|
homeassistant/components/myuplink/__init__.py
|
||||||
homeassistant/components/myuplink/api.py
|
homeassistant/components/myuplink/api.py
|
||||||
homeassistant/components/myuplink/application_credentials.py
|
homeassistant/components/myuplink/application_credentials.py
|
||||||
homeassistant/components/myuplink/binary_sensor.py
|
|
||||||
homeassistant/components/myuplink/coordinator.py
|
homeassistant/components/myuplink/coordinator.py
|
||||||
homeassistant/components/myuplink/entity.py
|
homeassistant/components/myuplink/entity.py
|
||||||
homeassistant/components/myuplink/helpers.py
|
homeassistant/components/myuplink/helpers.py
|
||||||
|
25
tests/components/myuplink/test_binary_sensor.py
Normal file
25
tests/components/myuplink/test_binary_sensor.py
Normal file
@ -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)",
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user