How to use the alexapy.AlexaAPI function in AlexaPy

To help you get started, we’ve selected a few AlexaPy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github macbury / SmartHouse / home-assistant / custom_components / alexa_media / media_player.py View on Github external
def __init__(self, device, login, hass):
        """Initialize the Alexa device."""
        from alexapy import AlexaAPI

        # Class info
        self._login = login
        self.alexa_api = AlexaAPI(self, login)
        self.auth = AlexaAPI.get_authentication(login)
        self.alexa_api_session = login.session
        self.account = hide_email(login.email)

        # Logged in info
        self._authenticated = None
        self._can_access_prime_music = None
        self._customer_email = None
        self._customer_id = None
        self._customer_name = None
        self._set_authentication_details(self.auth)

        # Device info
        self._device = None
        self._device_name = None
        self._device_serial_number = None
github eifinger / homeassistant-config / custom_components / alexa_media / alarm_control_panel.py View on Github external
def __init__(self, login, media_players=None) -> None:
        # pylint: disable=unexpected-keyword-arg
        """Initialize the Alexa device."""
        from alexapy import AlexaAPI

        # Class info
        self._login = login
        self.alexa_api = AlexaAPI(self, login)
        self.email = login.email
        self.account = hide_email(login.email)
        self._available = None
        self._assumed_state = None

        # Guard info
        self._appliance_id = None
        self._guard_entity_id = None
        self._friendly_name = "Alexa Guard"
        self._state = None
        self._should_poll = False
        self._attrs: Dict[Text, Text] = {}
        self._media_players = {} or media_players
github scottsweb / ham / homeassistant / custom_components / alexa_media / media_player.py View on Github external
def __init__(self, device, login):
        """Initialize the Alexa device."""
        from alexapy import AlexaAPI

        # Class info
        self._login = login
        self.alexa_api = AlexaAPI(self, login)
        self.auth = None
        self.alexa_api_session = login.session
        self.account = hide_email(login.email)

        # Logged in info
        self._authenticated = None
        self._can_access_prime_music = None
        self._customer_email = None
        self._customer_id = None
        self._customer_name = None

        # Device info
        self._device = None
        self._device_name = None
        self._device_serial_number = None
        self._device_type = None
github eliseomartelli / ParentsHomeAutomation / homeassistant / custom_components / alexa_media / alarm_control_panel.py View on Github external
def __init__(self, login) -> None:
        # pylint: disable=unexpected-keyword-arg
        """Initialize the Alexa device."""
        from alexapy import AlexaAPI

        # Class info
        self._login = login
        self.alexa_api = AlexaAPI(self, login)
        self.alexa_api_session = login.session
        self.account = hide_email(login.email)

        # Guard info
        self._appliance_id = None
        self._guard_entity_id = None
        self._friendly_name = "Alexa Guard"
        self._state = None
        self._should_poll = False
        self._attrs: Dict[Text, Text] = {}
github ikifar2012 / Home-AssistantConfig / custom_components / alexa_media / media_player.py View on Github external
def check_login_changes(self):
        """Update Login object if it has changed."""
        try:
            login = self.hass.data[DATA_ALEXAMEDIA]["accounts"][self.email]["login_obj"]
        except (AttributeError, KeyError):
            return
        if self._login != login:
            from alexapy import AlexaAPI

            _LOGGER.debug("Login object has changed; updating")
            self._login = login
            self.alexa_api = AlexaAPI(self, login)
            self.email = login.email
            self.account = hide_email(login.email)