コード例 #1
0
async def test_tilt_close_cover(hass: core.HomeAssistant):
    """Tests that tilt close cover command delegates to API."""
    await setup_platform(hass,
                         COVER_DOMAIN,
                         tilt_only_shades("name-1"),
                         bond_device_id="test-device-id")

    with patch_bond_action() as mock_close, patch_bond_device_state():
        await hass.services.async_call(
            COVER_DOMAIN,
            SERVICE_CLOSE_COVER_TILT,
            {ATTR_ENTITY_ID: "cover.name_1"},
            blocking=True,
        )
        await hass.async_block_till_done()

    mock_close.assert_called_once_with("test-device-id", Action.tilt_close())
    assert hass.states.get("cover.name_1").state == STATE_UNKNOWN
コード例 #2
0
ファイル: cover.py プロジェクト: jbouwh/core
 async def async_close_cover_tilt(self, **kwargs: Any) -> None:
     """Close the cover tilt."""
     await self._hub.bond.action(self._device.device_id,
                                 Action.tilt_close())