Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bool -- True if deletion successful
"""
from alexapy import AlexaAPI
requested_emails = call.data.get(ATTR_EMAIL)
items: int = int(call.data.get(ATTR_NUM_ENTRIES))
_LOGGER.debug(
"Service clear_history called for: %i items for %s", items, requested_emails
)
for email, account_dict in hass.data[DATA_ALEXAMEDIA]["accounts"].items():
if requested_emails and email not in requested_emails:
continue
login_obj = account_dict["login_obj"]
return await AlexaAPI.clear_history(login_obj, items)
bool -- True if deletion successful
"""
from alexapy import AlexaAPI
requested_emails = call.data.get(ATTR_EMAIL)
items: int = int(call.data.get(ATTR_NUM_ENTRIES))
_LOGGER.debug("Service clear_history called for: %i items for %s",
items,
requested_emails)
for email, account_dict in (hass.data
[DATA_ALEXAMEDIA]['accounts'].items()):
if requested_emails and email not in requested_emails:
continue
login_obj = account_dict['login_obj']
return await AlexaAPI.clear_history(login_obj, items)
bool -- True if deletion successful
"""
from alexapy import AlexaAPI
requested_emails = call.data.get(ATTR_EMAIL)
items: int = int(call.data.get(ATTR_NUM_ENTRIES))
_LOGGER.debug(
"Service clear_history called for: %i items for %s", items, requested_emails
)
for email, account_dict in hass.data[DATA_ALEXAMEDIA]["accounts"].items():
if requested_emails and email not in requested_emails:
continue
login_obj = account_dict["login_obj"]
return await AlexaAPI.clear_history(login_obj, items)
bool -- True if deletion successful
"""
from alexapy import AlexaAPI
requested_emails = call.data.get(ATTR_EMAIL)
items: int = int(call.data.get(ATTR_NUM_ENTRIES))
_LOGGER.debug(
"Service clear_history called for: %i items for %s", items, requested_emails
)
for email, account_dict in hass.data[DATA_ALEXAMEDIA]["accounts"].items():
if requested_emails and email not in requested_emails:
continue
login_obj = account_dict["login_obj"]
return await AlexaAPI.clear_history(login_obj, items)