This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
CustomInterfaceEventHandler (line 211) is getting into infinite loop #16
Comments
monupurohit
changed the title
CustomInterfaceEventHandler (line 211 is getting into infinite loop
CustomInterfaceEventHandler (line 211) is getting into infinite loop
Oct 25, 2020
Python code on RPiCopyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.These materials are licensed under the Amazon Software License in connection with the Alexa Gadgets Program.The Agreement is available at https://aws.amazon.com/asl/.See the Agreement for the specific terms and conditions of the Agreement.Capitalized terms not defined in this file have the meanings given to them in the Agreement.import json from gpiozero import RGBLED, Button, LED GPIO_PIN = 14 LED = LED(GPIO_PIN) logging.basicConfig(stream=sys.stdout, level=logging.INFO) GPIO PinsGPIO_LED_RED = 2 Setup RGB LEDset active_high to False for common anode RGB LEDelse set to True for common cathode RGB LEDRGB_LED = RGBLED(GPIO_LED_RED, GPIO_LED_GREEN, GPIO_LED_BLUE, Setup ButtonBUTTON = Button(GPIO_BUTTON) words_to_yell = 1 #any default valueclass ColorCyclerGadget(AlexaGadget):
if name == 'main': |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
//
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// These materials are licensed under the Amazon Software License in connection with the Alexa Gadgets Program.
// The Agreement is available at https://aws.amazon.com/asl/.
// See the Agreement for the specific terms and conditions of the Agreement.
// Capitalized terms not defined in this file have the meanings given to them in the Agreement.
//
'use strict';
const Alexa = require('ask-sdk-core');
const Uuid = require('uuid/v4');
let skill;
exports.handler = function(event, context) {
};
const handler = {
LaunchRequestHandler: {
canHandle(handlerInput) {
let { request } = handlerInput.requestEnvelope;
console.log("LaunchRequestHandler: checking if it can handle " + request.type);
return request.type === 'LaunchRequest';
},
async handle(handlerInput) {
console.log("== Launch Intent ==");
console.log(JSON.stringify(handlerInput.requestEnvelope));
};
function getConnectedEndpointsResponse(handlerInput) {
return handlerInput.serviceClientFactory.getEndpointEnumerationServiceClient().getEndpoints();
}
function buildBlinkLEDDirective(endpointId, colors_list, intervalMs, iterations, startGame) {
return {
type: 'CustomInterfaceController.SendDirective',
header: {
name: 'BlinkLED',
namespace: 'Custom.ColorCyclerGadget'
},
endpoint: {
endpointId: endpointId
},
payload: {
colors_list: colors_list,
intervalMs: intervalMs,
iterations: iterations,
startGame: startGame
}
};
}
function buildLightDirective(endpointId, colors_state, startGame) {
return {
type: 'CustomInterfaceController.SendDirective',
header: {
name: 'BlinkLight',
namespace: 'Custom.ColorCyclerGadget'
},
endpoint: {
endpointId: endpointId
},
payload: {
colors_state: colors_state,
startGame: startGame
}
};
}
function buildLightStopDirective(endpointId, colors_state, startGame) {
return {
type: 'CustomInterfaceController.SendDirective',
header: {
name: 'StopLight',
namespace: 'Custom.ColorCyclerGadget'
},
endpoint: {
endpointId: endpointId
},
payload: {
colors_state: colors_state,
startGame: startGame
}
};
}
function buildStopLEDDirective(endpointId) {
return {
type: 'CustomInterfaceController.SendDirective',
header: {
name: 'StopLED',
namespace: 'Custom.ColorCyclerGadget'
},
endpoint: {
endpointId: endpointId
},
payload: {}
};
}
function buildStartEventHandlerDirective(token, durationMs, namespace, name, filterMatchAction, expirationPayload) {
return {
type: "CustomInterfaceController.StartEventHandler",
token: token,
eventFilter: {
filterExpression: {
'and': [
{ '==': [{ 'var': 'header.namespace' }, namespace] },
{ '==': [{ 'var': 'header.name' }, name] }
]
},
filterMatchAction: filterMatchAction
},
expiration: {
durationInMilliseconds: durationMs,
expirationPayload: expirationPayload
}
};
}
function buildStopEventHandlerDirective(token) {
return {
type: "CustomInterfaceController.StopEventHandler",
token: token
};
}
The text was updated successfully, but these errors were encountered: