Skip to content

Commit

Permalink
Merge pull request #59 from MycroftAI/bugfix/override-idle-check
Browse files Browse the repository at this point in the history
Fix NoneType error when checking the existing override_idle
  • Loading branch information
krisgesling authored Jul 25, 2021
2 parents c761010 + 6b07143 commit ee29d45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,14 @@ def on_gui_page_show(self, message):
elif message.data["page"] and not message.data["page"][0].endswith(
"idle.qml"
):
# Check if the show_page deactivates a previous idle override
# Check if the idle override has been set and if this call of
# show_page should deactivate a previous idle override
# This is only possible if the page is from the same skill
self.log.info("Cancelling idle override")
if override_idle is False and compare_origin(
message, self.resting_screen.override_idle[0]
):
if self.resting_screen.override_idle is not None and \
override_idle is False and \
compare_origin(message,
self.resting_screen.override_idle[0]):
# Remove the idle override page if override is set to false
self.resting_screen.cancel_override()
# Set default idle screen timer
Expand Down

0 comments on commit ee29d45

Please sign in to comment.