You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@richard-collier this issue was automatically closed because it did not follow the issue template and this warning: IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.
I can change the service call to issue a warning instead of an error: custom_components/alexa_media/services.py lines 166-185:
# Retrieve the state and attributes
state = self.hass.states.get(entity_id)
if not state:
_LOGGER.warning("Entity %s has no state; cannot restore volume", entity_id)
return False
previous_volume = state.attributes.get('previous_volume')
current_volume = state.attributes.get('volume_level')
if previous_volume is None:
_LOGGER.warning(
"Previous volume not found for %s; attempting to use current volume level: %s",
entity_id,
current_volume,
)
previous_volume = current_volume
if previous_volume is None:
_LOGGER.warning("No valid volume levels found for entity %s; cannot restore volume", entity_id)
return False
Works as advertised unless the previous_volume attribute is null (which is it's value after a reboot). At that point, it returns an error.
The text was updated successfully, but these errors were encountered: