before cleanup

This commit is contained in:
root
2026-10-04 11:46:20 +02:00
parent 52442c50f1
commit c5dd4e7be2
63 changed files with 118877 additions and 38188 deletions

View File

@@ -33,13 +33,14 @@ async def async_setup(hass, config):
"""Setup example component."""
async def async_set_half_service(service):
entity_ids = await async_extract_entity_ids(hass, service, expand_group=True)
entity_ids = await async_extract_entity_ids(service, expand_group=True)
for entity_id in entity_ids:
if not entity_id.startswith(f"{COVER_DOMAIN}."):
state = hass.states.get(entity_id)
if not entity_id.startswith(f"{COVER_DOMAIN}.") or state is None:
continue
data = {
ATTR_ENTITY_ID: entity_id,
ATTR_POSITION: hass.states.get(entity_id).attributes.get(ATTR_HALF_POSITION, 20)
ATTR_POSITION: state.attributes.get(ATTR_HALF_POSITION, 20)
}
await hass.services.async_call(COVER_DOMAIN, SERVICE_SET_COVER_POSITION, data)