コード例 #1
0
ファイル: alexa.py プロジェクト: jimmingcheng/tesla_alexa
def build_skill() -> Callable:
    sb = StandardSkillBuilder()

    sb.add_request_handler(GetStatusIntentHandler())
    sb.add_request_handler(AutoConditioningStartIntentHandler())
    sb.add_request_handler(AutoConditioningStopIntentHandler())
    sb.add_request_handler(ChargeStartIntentHandler())
    sb.add_request_handler(ChargeStopIntentHandler())
    sb.add_request_handler(DoorLockIntentHandler())
    sb.add_request_handler(DoorUnlockIntentHandler())
    sb.add_exception_handler(CatchAllExceptionHandler())

    return sb.lambda_handler()
コード例 #2
0
        # type: (HandlerInput) -> None
        logger.info("Request Envelope: {}".format(
            handler_input.request_envelope))


class ResponseLogger(AbstractResponseInterceptor):
    """Log the response envelope."""
    def process(self, handler_input, response):
        # type: (HandlerInput, Response) -> None
        logger.info("Response: {}".format(response))


sb = StandardSkillBuilder()

sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(InProgressHowMuchIntent())
sb.add_request_handler(InProgressHowManyIntent())
sb.add_request_handler(HowMuchIsCryptoInFiat())
sb.add_request_handler(HowManyCryptoCanIBuy())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(FallbackIntentHandler())
sb.add_request_handler(SessionEndedHandler())
sb.add_request_handler(RepeatHandler())
sb.add_exception_handler(CatchAllExceptionHandler())
sb.add_global_request_interceptor(RequestLogger())
sb.add_global_response_interceptor(ResponseLogger())

lambda_handler = sb.lambda_handler()

#End of program
コード例 #3
0
sb.add_request_handler(StarAgeIntentHandler())

# Planets

sb.add_request_handler(PlanetDistanceHandler())
sb.add_request_handler(PlanetSizeHandler())
sb.add_request_handler(PlanetAgeIntentHandler())

# endregion

sb.add_request_handler(YesLearnMoreIntentHandler())
sb.add_request_handler(NoLearnMoreIntentHandler())

sb.add_request_handler(YesReviewSolarSystem())
sb.add_request_handler(NoReviewSolarSystem())

sb.add_request_handler(YesPlayAgainHandler())
sb.add_request_handler(NoPlayAgainHandler())

sb.add_request_handler(RepeatHandler())

sb.add_global_request_interceptor(SetupRequestInterceptor())

sb.add_global_response_interceptor(SaveSessionAttributesResponseInterceptor())

sb.add_exception_handler(AllExceptionHandler())

sb.add_request_handler(FallbackHandler())

lambda_handler = sb.lambda_handler()
コード例 #4
0
skill_builder.add_request_handler(ShuffleOnEpisodeHandler())
skill_builder.add_request_handler(ShuffleOffEpisodeHandler())
skill_builder.add_request_handler(StartOverEpisodeHandler())
skill_builder.add_request_handler(RepeatEpisodeHandler())
skill_builder.add_request_handler(PreviousEpisodeHandler())
skill_builder.add_request_handler(NextEpisodeHandler())
skill_builder.add_request_handler(LoopOnEpisodeHandler())
skill_builder.add_request_handler(LoopOffEpisodeHandler())
skill_builder.add_request_handler(HelpHandler())
skill_builder.add_request_handler(FallbackHandler())

# Event Handlers
skill_builder.add_request_handler(PlaybackNearlyFinishedHandler())
skill_builder.add_request_handler(PlaybackFailedHandler())
skill_builder.add_request_handler(PlaybackStartedHandler())
skill_builder.add_request_handler(PlaybackStoppedHandler())
skill_builder.add_request_handler(PlaybackFinishedHandler())

# Request Interceptors
skill_builder.add_global_request_interceptor(RequestLogger())
skill_builder.add_global_request_interceptor(LoadStateRequestInterceptor())

# Response Interceptors
skill_builder.add_global_response_interceptor(ResponseLogger())
skill_builder.add_global_response_interceptor(SaveStateResponseInterceptor())

# Exception Handler
skill_builder.add_exception_handler(CatchAllExceptionHandler())

lambda_handler = skill_builder.lambda_handler()
コード例 #5
0
from ask_sdk.standard import StandardSkillBuilder

from fallzahlen.handlers.today_handler import TodayIntentHandler
from fallzahlen.handlers.close_handler import CloseRequestHandler
from fallzahlen.handlers.help_handler import HelpHandler
from fallzahlen.handlers.fallback_handler import FallbackHandler
from fallzahlen.handlers.exception_handler import ExceptionHandler

builder = StandardSkillBuilder()
builder.add_request_handler(TodayIntentHandler())
builder.add_request_handler(CloseRequestHandler())
builder.add_request_handler(HelpHandler())
builder.add_request_handler(FallbackHandler())
builder.add_exception_handler(ExceptionHandler())

handler = builder.lambda_handler()
コード例 #6
0
        return handler_input.response_builder.response


# This handler acts as the entry point for your skill, routing all request and response
# payloads to the handlers above. Make sure any new handlers or interceptors you've
# defined are included below. The order matters - they're processed top to bottom.
sb = StandardSkillBuilder()
sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(WithContextIntentHandler())
sb.add_request_handler(GaneshaShopIntentHandler())
sb.add_request_handler(UseIntentHandler())
sb.add_request_handler(YesIntentHandler())
sb.add_request_handler(WhatHaveIGotIntentHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())

sb.add_request_handler(BuyHandler())
sb.add_request_handler(BuyResponseHandler())
sb.add_request_handler(WhatCanIBuyHandler())
sb.add_request_handler(ProductDetailHandler())
sb.add_request_handler(RefundProductHandler())
sb.add_request_handler(CancelResponseHandler())

sb.add_request_handler(
    IntentReflectorHandler())  # make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers

sb.add_exception_handler(ErrorHandler())

handler = sb.lambda_handler()