richtier / alexa-voice-service-client

Python Client for Alexa Voice Service (AVS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Host name should be input parameter

SivakumarBalu opened this issue · comments

Currently, host is hardcoded to old legacy url 'avs-alexa-eu.amazon.com'. AVS enforcing to use specific region Base URLs https://developer.amazon.com/docs/alexa-voice-service/api-overview.html#endpoints. For example, my client expected be connected with host North America Host Base URLs.

if the Host url is input parameter along with client id, secret and refresh_token, then it will useful to your package as it is instead of forking a copy.

the supported way to do this is:

class ConnectionManager(alexa_client.connection.ConnectionManager):
    host = ...

class AlexaClient(alexa_client.AlexaClient):
    connection_manager_class = ConnectionManager

adding host as a first class citizen paramater is indeed a good idea. I'll get on this soon

you can now set the base_url when instantiating the client:

from alexa_client.alexa_client import constants

client = AlexaClient(
    client_id='my-client-id',
    secret='my-secret',
    refresh_token='my-refresh-token',
    base_url=constants.BASE_URL_ASIA
)

read more

Thanks for fixing on short span!