1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-15 10:34:19 +01:00
Files
Marc Hörsken bb7433e10e Add service to perform a combined move and tilt of a WMS cover (#174570)
Co-authored-by: Norbert Rittel <norbert@rittel.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-08 20:33:05 +02:00

38 lines
1.1 KiB
Python

"""Services for WMS WebControl pro."""
import voluptuous as vol
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
DOMAIN as COVER_DOMAIN,
CoverEntityFeature,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import service
from .const import DOMAIN, SERVICE_SET_COVER_POSITION_AND_TILT
@callback
def async_setup_services(hass: HomeAssistant) -> None:
"""Set up services for WMS WebControl pro."""
service.async_register_platform_entity_service(
hass,
service_domain=DOMAIN,
service_name=SERVICE_SET_COVER_POSITION_AND_TILT,
entity_domain=COVER_DOMAIN,
func="async_set_cover_position_and_tilt",
required_features=[
CoverEntityFeature.SET_POSITION | CoverEntityFeature.SET_TILT_POSITION
],
schema={
vol.Required(ATTR_POSITION): vol.All(
vol.Coerce(int), vol.Range(min=0, max=100)
),
vol.Required(ATTR_TILT_POSITION): vol.All(
vol.Coerce(int), vol.Range(min=0, max=100)
),
},
)