From 9b14586568fc5489f64acf4dade1264aed6e08a6 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Thu, 21 Jan 2021 02:11:55 +0100 Subject: [PATCH] Add DemoCover with only tilt controls (#45228) * Add DemoCover with only tilt controls * Add default tilt position to Pergola Roof * Apply githooks (isort) * Add new demo device to Google Assistant fixtures --- homeassistant/components/demo/cover.py | 16 ++++++++++++++++ tests/components/google_assistant/__init__.py | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/homeassistant/components/demo/cover.py b/homeassistant/components/demo/cover.py index e65d6e59ece6..35f25df5a965 100644 --- a/homeassistant/components/demo/cover.py +++ b/homeassistant/components/demo/cover.py @@ -3,7 +3,11 @@ from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, SUPPORT_CLOSE, + SUPPORT_CLOSE_TILT, SUPPORT_OPEN, + SUPPORT_OPEN_TILT, + SUPPORT_SET_TILT_POSITION, + SUPPORT_STOP_TILT, CoverEntity, ) from homeassistant.core import callback @@ -26,6 +30,18 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= device_class="garage", supported_features=(SUPPORT_OPEN | SUPPORT_CLOSE), ), + DemoCover( + hass, + "cover_5", + "Pergola Roof", + tilt_position=60, + supported_features=( + SUPPORT_OPEN_TILT + | SUPPORT_STOP_TILT + | SUPPORT_CLOSE_TILT + | SUPPORT_SET_TILT_POSITION + ), + ), ] ) diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index 5927ee83d259..cb11f1ceaac4 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -143,6 +143,15 @@ DEMO_DEVICES = [ "type": "action.devices.types.BLINDS", "willReportState": False, }, + { + "id": "cover.pergola_roof", + "name": {"name": "Pergola Roof"}, + "traits": [ + "action.devices.traits.OpenClose", + ], + "type": "action.devices.types.BLINDS", + "willReportState": False, + }, { "id": "cover.hall_window", "name": {"name": "Hall Window"},