2022-06-03 13:33:43 +00:00
|
|
|
"""Test the Motion Blinds config flow."""
|
|
|
|
from unittest.mock import Mock
|
|
|
|
|
|
|
|
from motionblinds import DEVICE_TYPES_WIFI, BlindType
|
|
|
|
|
|
|
|
from homeassistant.components.motion_blinds.gateway import device_name
|
2023-02-08 18:06:59 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-06-03 13:33:43 +00:00
|
|
|
|
|
|
|
TEST_BLIND_MAC = "abcdefghujkl0001"
|
|
|
|
|
|
|
|
|
2023-02-08 18:06:59 +00:00
|
|
|
async def test_device_name(hass: HomeAssistant) -> None:
|
2022-06-03 13:33:43 +00:00
|
|
|
"""test_device_name."""
|
|
|
|
blind = Mock()
|
|
|
|
blind.blind_type = BlindType.RollerBlind.name
|
|
|
|
blind.mac = TEST_BLIND_MAC
|
|
|
|
assert device_name(blind) == "RollerBlind 0001"
|
|
|
|
|
|
|
|
blind.device_type = DEVICE_TYPES_WIFI[0]
|
|
|
|
assert device_name(blind) == "RollerBlind"
|