1
mirror of https://github.com/home-assistant/core synced 2024-07-24 16:42:06 +02:00

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
This commit is contained in:
Mick Vleeshouwer 2021-01-21 02:11:55 +01:00 committed by GitHub
parent 7a81ff55bc
commit 9b14586568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -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
),
),
]
)

View File

@ -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"},