(self,
                      data: RequestData,
                      capability_type: str,
                      instance: str,
                      state: dict[str, str | int | bool])
Execute action.

        https://yandex.ru/dev/dialogs/alice/doc/smart-home/reference/post-action-docpage/
Execute action.
Execute action .
async def execute(self,
                      data: RequestData,
                      capability_type: str,
                      instance: str,
                      state: dict[str, str | int | bool]) -> None:
        """Execute action.

        https://yandex.ru/dev/dialogs/alice/doc/smart-home/reference/post-action-docpage/
        """
        target_capabilities = [c for c in self.capabilities() if c.type == capability_type and c.instance == instance]
        if not target_capabilities:
            raise SmartHomeError(
                ERR_NOT_SUPPORTED_IN_CURRENT_MODE,
                f'Capability not found for instance {instance} ({capability_type}) of {self.state.entity_id}'
            )

        for capability in target_capabilities:
            try:
                await capability.set_state(data, state)
            except SmartHomeError:
                raise
            except Exception as e:
                raise SmartHomeError(
                    ERR_INTERNAL_ERROR,
                    f'Failed to execute action for instance {instance} ({capability_type}) of {self.state.entity_id}: '
                    f'{e!r}'
                )
async def execute ( self , data : RequestData , capability_type : str , instance : str , state : dict [ str , str | int | bool ] ) -> None : target_capabilities = [ c for c in self . capabilities ( ) if c . type == capability_type and c . instance == instance ] if not target_capabilities : raise SmartHomeError ( ERR_NOT_SUPPORTED_IN_CURRENT_MODE , f'Capability not found for instance {instance} ({capability_type}) of {self.state.entity_id}' ) for capability in target_capabilities : try : await capability . set_state ( data , state ) except SmartHomeError : raise except Exception as e : raise SmartHomeError ( ERR_INTERNAL_ERROR , f'Failed to execute action for instance {instance} ({capability_type}) of {self.state.entity_id}: ' f'{e!r}' )