Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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
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] = {}
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)