def METHOD_NAME(self, command, **kwargs):
    """Send commands to a device."""
    repeat = kwargs.get(remote.ATTR_NUM_REPEATS, remote.DEFAULT_NUM_REPEATS)
    delays = kwargs.get(remote.ATTR_DELAY_SECS, remote.DEFAULT_DELAY_SECS)
    did = kwargs.get(remote.ATTR_DEVICE)
    for _ in range(repeat):
        for cmd in command:
            try:
                if f'{cmd}'[:4] == 'key:':
                    ret = self.send_cloud_command(did, cmd)
                else:
                    ret = self._device.play(cmd)
                self.logger.info('%s: Send IR command %s(%s) result: %s', self.name_model, cmd, kwargs, ret)
            except (DeviceException, MiCloudException) as exc:
                self.logger.error('%s: Send IR command %s(%s) failed: %s', self.name_model, cmd, kwargs, exc)
            time.sleep(delays)