Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import time
from mycroft.audio import wait_while_speaking
from adapt.intent import IntentBuilder
from mycroft.messagebus.message import Message
from mycroft.skills.core import MycroftSkill, intent_handler, intent_file_handler
from mycroft.enclosure.api import EnclosureAPI


class StopSkill(MycroftSkill):
Expand All @@ -39,6 +42,13 @@ def handle_reboot(self, event):
@intent_file_handler("shutdown.intent")
def handle_shutdown(self, event):
if self.ask_yesno("confirm.shutdown") == "yes":
self.enclosure.eyes_color(70, 65, 69) # soft gray
self.speak_dialog('shutting.down')
wait_while_speaking()
for percentage in range(100, -1, -10):
self.enclosure.eyes_fill(percentage)
time.sleep(1)
self.enclosure.eyes_brightness(0)
self.bus.emit(Message("system.shutdown"))

@intent_file_handler('wifi.setup.intent')
Expand Down
1 change: 1 addition & 0 deletions dialog/en-us/shutting.down.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Shutting down . . . Wait 10 seconds before disconnecting power.