Move Cycle command from cover to button (#89043)

Declare Cycle command as a button
This commit is contained in:
Thibaut 2023-03-03 08:38:07 +01:00 committed by GitHub
parent 0f493d85c8
commit a5cf8210ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from pyoverkiz.enums import OverkizCommand
from pyoverkiz.types import StateType as OverkizStateType from pyoverkiz.types import StateType as OverkizStateType
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
@ -65,6 +66,11 @@ BUTTON_DESCRIPTIONS: list[OverkizButtonDescription] = [
name="My position", name="My position",
icon="mdi:star", icon="mdi:star",
), ),
OverkizButtonDescription(
key=OverkizCommand.CYCLE,
name="Toggle",
icon="mdi:sync",
),
] ]
SUPPORTED_COMMANDS = { SUPPORTED_COMMANDS = {

View File

@ -27,13 +27,11 @@ COMMANDS_STOP_TILT: list[OverkizCommand] = [
COMMANDS_OPEN: list[OverkizCommand] = [ COMMANDS_OPEN: list[OverkizCommand] = [
OverkizCommand.OPEN, OverkizCommand.OPEN,
OverkizCommand.UP, OverkizCommand.UP,
OverkizCommand.CYCLE,
] ]
COMMANDS_OPEN_TILT: list[OverkizCommand] = [OverkizCommand.OPEN_SLATS] COMMANDS_OPEN_TILT: list[OverkizCommand] = [OverkizCommand.OPEN_SLATS]
COMMANDS_CLOSE: list[OverkizCommand] = [ COMMANDS_CLOSE: list[OverkizCommand] = [
OverkizCommand.CLOSE, OverkizCommand.CLOSE,
OverkizCommand.DOWN, OverkizCommand.DOWN,
OverkizCommand.CYCLE,
] ]
COMMANDS_CLOSE_TILT: list[OverkizCommand] = [OverkizCommand.CLOSE_SLATS] COMMANDS_CLOSE_TILT: list[OverkizCommand] = [OverkizCommand.CLOSE_SLATS]