-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to myuplink binary_sensor (#110995)
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)", | ||
} |