Alexa Reminder: SCHEDULE_RELATIVE не работает - PullRequest
0 голосов
/ 03 февраля 2020

Я пытался запланировать относительное напоминание о моем навыке Alexa, но он продолжает добавляться в обработчик исключений. Я пробовал разные способы сделать напоминание, но все же не смог запланировать один. Любые советы о том, как мне следует подойти к этому вопросу?

    tz_SG = pytz.timezone('Asia/Singapore')
    request_time = datetime.now(tz_SG).strftime("%Y-%m-%dT%H:%M:%S.%f")
    trigger = Trigger(object_type=TriggerType.SCHEDULED_RELATIVE, offset_in_seconds=10)
    text = SpokenText(locale = 'en-SG', ssml = '<speak>This is your reminder</speak>', text = 'This is your reminder')
    alert_info = AlertInfo(spoken_info=SpokenInfo(content=[text]))
    push_notification = PushNotification(status=PushNotificationStatus.ENABLED)
    reminder_request = ReminderRequest(request_time, trigger, alert_info, push_notification)

    reminder_response = reminderApiClient.create_reminder(reminder_request)
    speech_text = "Great! I've activated the medication reminders for you."
    logger.info("Created reminder: {}". format(reminder_response))
    return handler_input.response_builder.speak(speech_text).set_card(SimpleCard("Reminder created with id", reminder_response.alert_token)).response
...