diff --git a/.coveragerc b/.coveragerc index a23e71e5b45..fd8dee9dc69 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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 diff --git a/tests/components/myuplink/test_binary_sensor.py b/tests/components/myuplink/test_binary_sensor.py new file mode 100644 index 00000000000..24bfe49985d --- /dev/null +++ b/tests/components/myuplink/test_binary_sensor.py @@ -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)", + }