ovos-skill-naptime 0.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. ovos-skill-naptime-0.3.8/LICENSE +202 -0
  2. ovos-skill-naptime-0.3.8/MANIFEST.in +3 -0
  3. ovos-skill-naptime-0.3.8/PKG-INFO +60 -0
  4. ovos-skill-naptime-0.3.8/README.md +48 -0
  5. ovos-skill-naptime-0.3.8/__init__.py +222 -0
  6. ovos-skill-naptime-0.3.8/gui/qt5/Face.qml +133 -0
  7. ovos-skill-naptime-0.3.8/gui/qt5/awake.qml +16 -0
  8. ovos-skill-naptime-0.3.8/gui/qt5/face/Eyeball.svg +3 -0
  9. ovos-skill-naptime-0.3.8/gui/qt5/face/GreySmile.svg +3 -0
  10. ovos-skill-naptime-0.3.8/gui/qt5/face/Smile.svg +3 -0
  11. ovos-skill-naptime-0.3.8/gui/qt5/face/lid.svg +3 -0
  12. ovos-skill-naptime-0.3.8/gui/qt5/face/upper-lid.svg +3 -0
  13. ovos-skill-naptime-0.3.8/gui/qt5/resting.qml +16 -0
  14. ovos-skill-naptime-0.3.8/locale/ca-es/SleepCommand.voc +2 -0
  15. ovos-skill-naptime-0.3.8/locale/ca-es/going.to.sleep.dialog +3 -0
  16. ovos-skill-naptime-0.3.8/locale/ca-es/going.to.sleep.short.dialog +2 -0
  17. ovos-skill-naptime-0.3.8/locale/ca-es/i.am.awake.dialog +1 -0
  18. ovos-skill-naptime-0.3.8/locale/ca-es/naptime.intent +27 -0
  19. ovos-skill-naptime-0.3.8/locale/cs-cz/SleepCommand.voc +3 -0
  20. ovos-skill-naptime-0.3.8/locale/cs-cz/going.to.sleep.dialog +3 -0
  21. ovos-skill-naptime-0.3.8/locale/cs-cz/going.to.sleep.short.dialog +2 -0
  22. ovos-skill-naptime-0.3.8/locale/cs-cz/i.am.awake.dialog +1 -0
  23. ovos-skill-naptime-0.3.8/locale/da-dk/going.to.sleep.dialog +3 -0
  24. ovos-skill-naptime-0.3.8/locale/da-dk/going.to.sleep.short.dialog +2 -0
  25. ovos-skill-naptime-0.3.8/locale/da-dk/i.am.awake.dialog +1 -0
  26. ovos-skill-naptime-0.3.8/locale/da-dk/naptime.intent +30 -0
  27. ovos-skill-naptime-0.3.8/locale/de-de/SleepCommand.voc +2 -0
  28. ovos-skill-naptime-0.3.8/locale/de-de/going.to.sleep.dialog +3 -0
  29. ovos-skill-naptime-0.3.8/locale/de-de/going.to.sleep.short.dialog +2 -0
  30. ovos-skill-naptime-0.3.8/locale/de-de/i.am.awake.dialog +1 -0
  31. ovos-skill-naptime-0.3.8/locale/de-de/naptime.intent +40 -0
  32. ovos-skill-naptime-0.3.8/locale/el-gr/going.to.sleep.dialog +3 -0
  33. ovos-skill-naptime-0.3.8/locale/el-gr/going.to.sleep.short.dialog +2 -0
  34. ovos-skill-naptime-0.3.8/locale/el-gr/i.am.awake.dialog +1 -0
  35. ovos-skill-naptime-0.3.8/locale/en-us/going.to.sleep.dialog +3 -0
  36. ovos-skill-naptime-0.3.8/locale/en-us/going.to.sleep.short.dialog +2 -0
  37. ovos-skill-naptime-0.3.8/locale/en-us/i.am.awake.dialog +1 -0
  38. ovos-skill-naptime-0.3.8/locale/en-us/naptime.intent +31 -0
  39. ovos-skill-naptime-0.3.8/locale/en-us/skill.json +17 -0
  40. ovos-skill-naptime-0.3.8/locale/en-us/wakeup.voc +1 -0
  41. ovos-skill-naptime-0.3.8/locale/es-es/SleepCommand.voc +2 -0
  42. ovos-skill-naptime-0.3.8/locale/es-es/going.to.sleep.dialog +3 -0
  43. ovos-skill-naptime-0.3.8/locale/es-es/going.to.sleep.short.dialog +2 -0
  44. ovos-skill-naptime-0.3.8/locale/es-es/i.am.awake.dialog +1 -0
  45. ovos-skill-naptime-0.3.8/locale/eu-eu/SleepCommand.voc +3 -0
  46. ovos-skill-naptime-0.3.8/locale/eu-eu/going.to.sleep.dialog +2 -0
  47. ovos-skill-naptime-0.3.8/locale/eu-eu/going.to.sleep.short.dialog +3 -0
  48. ovos-skill-naptime-0.3.8/locale/eu-eu/i.am.awake.dialog +3 -0
  49. ovos-skill-naptime-0.3.8/locale/fa-ir/SleepCommand.voc +2 -0
  50. ovos-skill-naptime-0.3.8/locale/fa-ir/going.to.sleep.dialog +3 -0
  51. ovos-skill-naptime-0.3.8/locale/fa-ir/going.to.sleep.short.dialog +2 -0
  52. ovos-skill-naptime-0.3.8/locale/fa-ir/i.am.awake.dialog +1 -0
  53. ovos-skill-naptime-0.3.8/locale/fr-fr/SleepCommand.voc +2 -0
  54. ovos-skill-naptime-0.3.8/locale/fr-fr/going.to.sleep.dialog +3 -0
  55. ovos-skill-naptime-0.3.8/locale/fr-fr/going.to.sleep.short.dialog +2 -0
  56. ovos-skill-naptime-0.3.8/locale/fr-fr/i.am.awake.dialog +1 -0
  57. ovos-skill-naptime-0.3.8/locale/gl-es/SleepCommand.voc +2 -0
  58. ovos-skill-naptime-0.3.8/locale/gl-es/going.to.sleep.dialog +3 -0
  59. ovos-skill-naptime-0.3.8/locale/gl-es/going.to.sleep.short.dialog +2 -0
  60. ovos-skill-naptime-0.3.8/locale/gl-es/i.am.awake.dialog +1 -0
  61. ovos-skill-naptime-0.3.8/locale/hu-hu/SleepCommand.voc +4 -0
  62. ovos-skill-naptime-0.3.8/locale/hu-hu/going.to.sleep.dialog +3 -0
  63. ovos-skill-naptime-0.3.8/locale/hu-hu/going.to.sleep.short.dialog +1 -0
  64. ovos-skill-naptime-0.3.8/locale/hu-hu/i.am.awake.dialog +1 -0
  65. ovos-skill-naptime-0.3.8/locale/it-it/SleepCommand.voc +2 -0
  66. ovos-skill-naptime-0.3.8/locale/it-it/going.to.sleep.dialog +3 -0
  67. ovos-skill-naptime-0.3.8/locale/it-it/going.to.sleep.short.dialog +2 -0
  68. ovos-skill-naptime-0.3.8/locale/it-it/i.am.awake.dialog +1 -0
  69. ovos-skill-naptime-0.3.8/locale/it-it/naptime.intent +16 -0
  70. ovos-skill-naptime-0.3.8/locale/nl-nl/SleepCommand.voc +2 -0
  71. ovos-skill-naptime-0.3.8/locale/nl-nl/going.to.sleep.dialog +3 -0
  72. ovos-skill-naptime-0.3.8/locale/nl-nl/going.to.sleep.short.dialog +2 -0
  73. ovos-skill-naptime-0.3.8/locale/nl-nl/i.am.awake.dialog +1 -0
  74. ovos-skill-naptime-0.3.8/locale/pl-pl/SleepCommand.voc +2 -0
  75. ovos-skill-naptime-0.3.8/locale/pl-pl/going.to.sleep.dialog +3 -0
  76. ovos-skill-naptime-0.3.8/locale/pl-pl/going.to.sleep.short.dialog +2 -0
  77. ovos-skill-naptime-0.3.8/locale/pl-pl/i.am.awake.dialog +1 -0
  78. ovos-skill-naptime-0.3.8/locale/pt-br/SleepCommand.voc +2 -0
  79. ovos-skill-naptime-0.3.8/locale/pt-br/going.to.sleep.dialog +3 -0
  80. ovos-skill-naptime-0.3.8/locale/pt-br/going.to.sleep.short.dialog +2 -0
  81. ovos-skill-naptime-0.3.8/locale/pt-br/i.am.awake.dialog +1 -0
  82. ovos-skill-naptime-0.3.8/locale/pt-pt/SleepCommand.voc +2 -0
  83. ovos-skill-naptime-0.3.8/locale/pt-pt/going.to.sleep.dialog +3 -0
  84. ovos-skill-naptime-0.3.8/locale/pt-pt/going.to.sleep.short.dialog +2 -0
  85. ovos-skill-naptime-0.3.8/locale/pt-pt/i.am.awake.dialog +1 -0
  86. ovos-skill-naptime-0.3.8/locale/pt-pt/naptime.intent +9 -0
  87. ovos-skill-naptime-0.3.8/locale/ro-ro/SleepCommand.voc +2 -0
  88. ovos-skill-naptime-0.3.8/locale/ro-ro/going.to.sleep.dialog +3 -0
  89. ovos-skill-naptime-0.3.8/locale/ro-ro/going.to.sleep.short.dialog +2 -0
  90. ovos-skill-naptime-0.3.8/locale/ro-ro/i.am.awake.dialog +1 -0
  91. ovos-skill-naptime-0.3.8/locale/ru-ru/SleepCommand.voc +2 -0
  92. ovos-skill-naptime-0.3.8/locale/ru-ru/going.to.sleep.dialog +3 -0
  93. ovos-skill-naptime-0.3.8/locale/ru-ru/going.to.sleep.short.dialog +2 -0
  94. ovos-skill-naptime-0.3.8/locale/ru-ru/i.am.awake.dialog +1 -0
  95. ovos-skill-naptime-0.3.8/locale/sv-se/SleepCommand.voc +2 -0
  96. ovos-skill-naptime-0.3.8/locale/sv-se/going.to.sleep.dialog +3 -0
  97. ovos-skill-naptime-0.3.8/locale/sv-se/going.to.sleep.short.dialog +2 -0
  98. ovos-skill-naptime-0.3.8/locale/sv-se/i.am.awake.dialog +1 -0
  99. ovos-skill-naptime-0.3.8/locale/tr-tr/SleepCommand.voc +2 -0
  100. ovos-skill-naptime-0.3.8/locale/tr-tr/going.to.sleep.dialog +3 -0
  101. ovos-skill-naptime-0.3.8/locale/tr-tr/going.to.sleep.short.dialog +2 -0
  102. ovos-skill-naptime-0.3.8/locale/tr-tr/i.am.awake.dialog +1 -0
  103. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/PKG-INFO +60 -0
  104. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/SOURCES.txt +110 -0
  105. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/dependency_links.txt +1 -0
  106. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/entry_points.txt +3 -0
  107. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/requires.txt +3 -0
  108. ovos-skill-naptime-0.3.8/ovos_skill_naptime.egg-info/top_level.txt +1 -0
  109. ovos-skill-naptime-0.3.8/requirements.txt +3 -0
  110. ovos-skill-naptime-0.3.8/setup.cfg +4 -0
  111. ovos-skill-naptime-0.3.8/setup.py +93 -0
  112. ovos-skill-naptime-0.3.8/version.py +6 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ recursive-include locale *
2
+ recursive-include gui *
3
+ include *.txt
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.1
2
+ Name: ovos-skill-naptime
3
+ Version: 0.3.8
4
+ Summary: ovos skill plugin
5
+ Home-page: https://github.com/OpenVoiceOS/skill-ovos-naptime
6
+ Author: JarbasAi
7
+ Author-email: jarbasai@mailfence.com
8
+ License: Apache-2.0
9
+ Description: # <img src='https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/bed.svg' card_color='#22a7f0' width='50' height='50' style='vertical-align:bottom'/> Naptime
10
+
11
+ Put the assistant to sleep when you don't want to be disturbed.
12
+
13
+ ## About
14
+
15
+ Tell the assistant to sleep when you don't want to be disturbed in any way.
16
+ This stops all calls to Speech to Text system, guaranteeing your voice won't be sent anywhere on an accidental activation.
17
+
18
+ When sleeping, the assistant will only listen locally for the wake word `Hey Mycroft, wake up`. Otherwise the system will be totally silent and won't bother you.
19
+
20
+ On a Mark 1 device this also dims the eyes.
21
+
22
+ Skill can mute the audio as well when entering into sleep mode if required.
23
+
24
+ ## Configuration
25
+
26
+ The skill utilizes the `~/.config/mycroft/skills/skill-ovos-naptime.openvoiceos/settings.json` file which allows you to configure this skill.
27
+
28
+ ```json
29
+ {
30
+ "mute": false
31
+ }
32
+ ```
33
+
34
+ ## Examples
35
+
36
+ - "Go to sleep"
37
+ - "Nap time"
38
+ - "Wake up"
39
+
40
+ ## Credits
41
+
42
+ OpenVoiceOS (@OpenVoiceOS)
43
+ Mycroft AI (@MycroftAI)
44
+
45
+ ## Category
46
+
47
+ **Daily**
48
+ Configuration
49
+
50
+ ## Tags
51
+
52
+ #nap
53
+ #naptime
54
+ #sleep
55
+ #donotdisturb
56
+ #do-not-disturb
57
+
58
+ Keywords: ovos skill plugin
59
+ Platform: UNKNOWN
60
+ Description-Content-Type: text/markdown
@@ -0,0 +1,48 @@
1
+ # <img src='https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/bed.svg' card_color='#22a7f0' width='50' height='50' style='vertical-align:bottom'/> Naptime
2
+
3
+ Put the assistant to sleep when you don't want to be disturbed.
4
+
5
+ ## About
6
+
7
+ Tell the assistant to sleep when you don't want to be disturbed in any way.
8
+ This stops all calls to Speech to Text system, guaranteeing your voice won't be sent anywhere on an accidental activation.
9
+
10
+ When sleeping, the assistant will only listen locally for the wake word `Hey Mycroft, wake up`. Otherwise the system will be totally silent and won't bother you.
11
+
12
+ On a Mark 1 device this also dims the eyes.
13
+
14
+ Skill can mute the audio as well when entering into sleep mode if required.
15
+
16
+ ## Configuration
17
+
18
+ The skill utilizes the `~/.config/mycroft/skills/skill-ovos-naptime.openvoiceos/settings.json` file which allows you to configure this skill.
19
+
20
+ ```json
21
+ {
22
+ "mute": false
23
+ }
24
+ ```
25
+
26
+ ## Examples
27
+
28
+ - "Go to sleep"
29
+ - "Nap time"
30
+ - "Wake up"
31
+
32
+ ## Credits
33
+
34
+ OpenVoiceOS (@OpenVoiceOS)
35
+ Mycroft AI (@MycroftAI)
36
+
37
+ ## Category
38
+
39
+ **Daily**
40
+ Configuration
41
+
42
+ ## Tags
43
+
44
+ #nap
45
+ #naptime
46
+ #sleep
47
+ #donotdisturb
48
+ #do-not-disturb
@@ -0,0 +1,222 @@
1
+ # Copyright 2017, Mycroft AI Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import time
16
+
17
+ from ovos_bus_client.message import Message
18
+ from ovos_config import Configuration
19
+ from ovos_utils import classproperty
20
+ from ovos_utils.process_utils import RuntimeRequirements
21
+ from ovos_workshop.decorators import intent_handler
22
+ from ovos_workshop.intents import IntentBuilder
23
+ from ovos_workshop.skills import OVOSSkill
24
+
25
+
26
+ class NapTimeSkill(OVOSSkill):
27
+ """Skill to handle mycroft speech client listener sleeping."""
28
+
29
+ @classproperty
30
+ def runtime_requirements(self):
31
+ return RuntimeRequirements(
32
+ internet_before_load=False,
33
+ network_before_load=False,
34
+ gui_before_load=False,
35
+ requires_internet=False,
36
+ requires_network=False,
37
+ requires_gui=False,
38
+ no_internet_fallback=True,
39
+ no_network_fallback=True,
40
+ no_gui_fallback=True,
41
+ )
42
+
43
+ def initialize(self):
44
+ self.started_by_skill = False
45
+ self.sleeping = False
46
+ self.old_brightness = 30
47
+ self.add_event("mycroft.awoken", self.handle_awoken)
48
+ self.add_event("mycroft.awoken", self.mark1_wake_up_animation)
49
+ self.add_event("recognizer_loop:sleep", self.mark1_sleep_animation)
50
+ self.add_event("mycroft.awoken", self.display_waking_face)
51
+ self.add_event("recognizer_loop:sleep", self.display_sleep_face)
52
+ self.disabled_confirm_listening = False
53
+
54
+ @property
55
+ def mute(self):
56
+ return self.settings.get("mute", False)
57
+
58
+ @property
59
+ def wake_word(self):
60
+ default = Configuration().get("listener", {}).get("wake_word")
61
+ # with multiple wakewords we can't be 100% sure what the correct name is
62
+ # a device might have multiple names
63
+ # - if the wake_word is set in listener consider that the main wakeword
64
+ # - if the wake_word in listener config does not have a ww config ignore it
65
+ # - else use the first hotword that listens and is set to self.lang, assume config is
66
+ # ordered by priority
67
+ # - else use the first hotword that listens, assume config is ordered by priority
68
+
69
+ hotwords = Configuration().get("hotwords", {})
70
+ if default in hotwords:
71
+ return default
72
+
73
+ # gather hotwords that trigger listening
74
+ candidates = {}
75
+ for ww_name, ww_conf in hotwords.items():
76
+ if ww_conf.get("listen"):
77
+ candidates[ww_name] = ww_conf
78
+
79
+ if candidates:
80
+ # preference to main language
81
+ for ww_name, ww_conf in candidates.items():
82
+ if ww_conf.get("lang", "") == self.lang:
83
+ return ww_name
84
+ # assume ordered by preference in config
85
+ return candidates[0]
86
+ return default
87
+
88
+ # TODO move mark1 handlers to PHAL mk1 plugin
89
+ def mark1_sleep_animation(self, message: Message):
90
+ time.sleep(0.5)
91
+ # Dim and look downward to 'go to sleep'
92
+ # TODO: Get current brightness from somewhere
93
+ self.old_brightness = 30
94
+ for i in range(0, (self.old_brightness - 10) // 2):
95
+ self.enclosure.eyes_brightness(self.old_brightness - i * 2)
96
+ time.sleep(0.15)
97
+ self.enclosure.eyes_look("d")
98
+
99
+ def mark1_wake_up_animation(self, message: Message):
100
+ """Mild animation to come out of sleep from voice command.
101
+
102
+ Pop open eyes and wait a sec.
103
+ """
104
+ self.enclosure.eyes_reset()
105
+ time.sleep(1)
106
+ self.enclosure.eyes_blink("b")
107
+ time.sleep(1)
108
+ # brighten the rest of the way
109
+ self.enclosure.eyes_brightness(self.old_brightness)
110
+
111
+ # GUI integration
112
+ def display_sleep_face(self) -> None:
113
+ """Display the sleeping face depending on the platform."""
114
+ self.gui.show_page("resting", override_idle=True)
115
+ self.set_context("sleeping_state")
116
+
117
+ def display_waking_face(self) -> None:
118
+ """Display the waking face depending on the platform."""
119
+ self.gui.remove_page("resting")
120
+ self.gui.show_page("awake", override_idle=5)
121
+ # TODO Screen not reverting after the specified 5 seconds.
122
+ # The following 2 lines shouldn't be needed. Remove when fixed.
123
+ time.sleep(5)
124
+ self.gui.release()
125
+
126
+ # TODO notifications api not yet merged
127
+ # merge this into ovos_workshop
128
+ def show_notification(self, content, action=None, noticetype="transient"):
129
+ """Display a Notification on homepage in the GUI.
130
+ Arguments:
131
+ content (str): Main text content of a notification, Limited
132
+ to two visual lines.
133
+ action (str): Callback to any event registered by the skill
134
+ to perform a certain action when notification is
135
+ clicked.
136
+ noticetype (str):
137
+ transient: 'Default' displays a notification with a timeout.
138
+ sticky: displays a notification that sticks to the screen.
139
+ """
140
+ self.bus.emit(
141
+ Message(
142
+ "homescreen.notification.set",
143
+ data={
144
+ "sender": self.skill_id,
145
+ "text": content,
146
+ "action": action,
147
+ "type": noticetype,
148
+ },
149
+ )
150
+ )
151
+
152
+ def handle_speak(self, message: Message):
153
+ if self.sleeping:
154
+ utt = message.data["utterance"]
155
+ self.show_notification(utt)
156
+
157
+ @intent_handler("naptime.intent")
158
+ def handle_go_to_sleep(self, message: Message):
159
+ """Sends a message to the speech client putting the listener to sleep.
160
+
161
+ If the user has been told about the waking up process five times
162
+ already, it sends a shorter message.
163
+ """
164
+ if self.wake_word:
165
+ self.speak_dialog(
166
+ "going.to.sleep", {"wake_word": self.wake_word}, wait=True
167
+ )
168
+ else:
169
+ self.speak_dialog("going.to.sleep.short", wait=True)
170
+
171
+ self.bus.emit(Message("recognizer_loop:sleep"))
172
+ self.sleeping = True
173
+ self.started_by_skill = True
174
+ if self.mute:
175
+ self.bus.emit(Message("mycroft.volume.mute"))
176
+ if self.config_core["confirm_listening"]:
177
+ self.disable_confirm_listening()
178
+ self.set_context("sleeping_state")
179
+
180
+ @intent_handler(IntentBuilder("WakeUp").require("wakeup").require("sleeping_state"))
181
+ def handle_wakeup(self, message: Message):
182
+ """STT is disabled, but command can be sent via cli"""
183
+ self.started_by_skill = True
184
+ # tell ovos-listener to wake up
185
+ self.bus.emit(message.forward("recognizer_loop:wake_up"))
186
+
187
+ def handle_awoken(self, message: Message):
188
+ """Handler for the mycroft.awoken message
189
+
190
+ The message is sent when the listener hears 'Hey Mycroft, Wake Up',
191
+ this handles the user interaction upon wake up.
192
+ """
193
+ started_by_skill = self.started_by_skill
194
+ self.awaken()
195
+ if started_by_skill:
196
+ # Announce that the unit is awake
197
+ self.speak_dialog("i.am.awake", wait=True)
198
+
199
+ def awaken(self):
200
+ if self.mute:
201
+ self.bus.emit(Message("mycroft.volume.unmute"))
202
+ if self.disabled_confirm_listening:
203
+ self.enable_confirm_listening()
204
+ self.sleeping = False
205
+ self.started_by_skill = False
206
+ self.remove_context("sleeping_state")
207
+
208
+ def disable_confirm_listening(self):
209
+ msg = Message(
210
+ "configuration.patch", data={"config": {"confirm_listening": False}}
211
+ )
212
+ self.bus.emit(msg)
213
+ self.disabled_confirm_listening = True
214
+ self.log.info("Disabled listen sound")
215
+
216
+ def enable_confirm_listening(self):
217
+ msg = Message(
218
+ "configuration.patch", data={"config": {"confirm_listening": True}}
219
+ )
220
+ self.bus.emit(msg)
221
+ self.disabled_confirm_listening = False
222
+ self.log.info("Enabled listen sound")
@@ -0,0 +1,133 @@
1
+ import QtQuick.Layouts 1.4
2
+ import QtQuick 2.4
3
+ import QtQuick.Controls 2.0
4
+ import org.kde.kirigami 2.4 as Kirigami
5
+
6
+ import Mycroft 1.0 as Mycroft
7
+
8
+ Item {
9
+ id: root
10
+
11
+ property bool eyesOpen
12
+ property string mouth
13
+ property alias mouthItem: mouthItem
14
+
15
+ Item {
16
+ id: fixedProportionsContainer
17
+
18
+ anchors.centerIn: parent
19
+ readonly property real proportion: 1.6
20
+
21
+ width: parent.height / parent.width >= proportion ? parent.width : height / 1.6
22
+ height: parent.height / parent.width >= proportion ? width * 1.6 : parent.height
23
+
24
+ Item {
25
+ anchors {
26
+ left: parent.left
27
+ top: parent.top
28
+ topMargin: parent.height * 0.28
29
+ leftMargin: parent.width * 0.02
30
+ }
31
+
32
+ width: parent.width * 0.35
33
+ height: width
34
+ Image {
35
+ anchors.fill: parent
36
+ visible: root.eyesOpen
37
+ source: Qt.resolvedUrl("face/Eyeball.svg")
38
+ fillMode: Image.PreserveAspectFit
39
+ }
40
+ Image {
41
+ anchors {
42
+ left: parent.left
43
+ right: parent.right
44
+ bottom: parent.bottom
45
+ leftMargin: width * 0.001
46
+ rightMargin: width * 0.001
47
+ }
48
+ height: width / (sourceSize.width/sourceSize.height)
49
+ visible: !root.eyesOpen
50
+ source: Qt.resolvedUrl("face/lid.svg")
51
+ fillMode: Image.PreserveAspectFit
52
+ }
53
+ Image {
54
+ anchors {
55
+ left: parent.left
56
+ right: parent.right
57
+ top: parent.top
58
+ leftMargin: width * 0.001
59
+ rightMargin: width * 0.001
60
+ }
61
+ height: width / (sourceSize.width/sourceSize.height)
62
+ visible: root.eyesOpen
63
+ source: Qt.resolvedUrl("face/upper-lid.svg")
64
+ fillMode: Image.PreserveAspectFit
65
+ }
66
+ }
67
+
68
+ Item {
69
+ anchors {
70
+ right: parent.right
71
+ top: parent.top
72
+ topMargin: parent.height * 0.28
73
+ rightMargin: parent.width * 0.02
74
+ }
75
+
76
+ width: parent.width * 0.35
77
+ height: width
78
+ Image {
79
+ anchors.fill: parent
80
+ visible: root.eyesOpen
81
+ source: Qt.resolvedUrl("face/Eyeball.svg")
82
+ fillMode: Image.PreserveAspectFit
83
+ }
84
+ Image {
85
+ anchors {
86
+ left: parent.left
87
+ right: parent.right
88
+ bottom: parent.bottom
89
+ leftMargin: width * 0.001
90
+ rightMargin: width * 0.001
91
+ }
92
+ height: width / (sourceSize.width/sourceSize.height)
93
+ visible: !root.eyesOpen
94
+ source: Qt.resolvedUrl("face/lid.svg")
95
+ fillMode: Image.PreserveAspectFit
96
+ }
97
+ Image {
98
+ anchors {
99
+ left: parent.left
100
+ right: parent.right
101
+ top: parent.top
102
+ leftMargin: width * 0.001
103
+ rightMargin: width * 0.001
104
+ }
105
+ height: width / (sourceSize.width/sourceSize.height)
106
+ visible: root.eyesOpen
107
+ source: Qt.resolvedUrl("face/upper-lid.svg")
108
+ fillMode: Image.PreserveAspectFit
109
+ }
110
+ }
111
+
112
+ Item {
113
+ id: mouthItem
114
+ anchors {
115
+ horizontalCenter: parent.horizontalCenter
116
+ bottom: parent.bottom
117
+ bottomMargin: parent.height * 0.26
118
+ }
119
+ width: parent.width / 2
120
+ height: smile.implicitHeight
121
+ Image {
122
+ id: smile
123
+ anchors {
124
+ left: parent.left
125
+ right: parent.right
126
+ verticalCenter: parent.verticalCenter
127
+ }
128
+ fillMode: Image.PreserveAspectFit
129
+ source: Qt.resolvedUrl("face/" + root.mouth)
130
+ }
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,16 @@
1
+ import QtQuick.Layouts 1.4
2
+ import QtQuick 2.4
3
+ import QtQuick.Controls 2.0
4
+ import org.kde.kirigami 2.4 as Kirigami
5
+
6
+ import Mycroft 1.0 as Mycroft
7
+
8
+ Mycroft.CardDelegate {
9
+ id: root
10
+
11
+ contentItem: Face {
12
+ eyesOpen: true
13
+ mouth: "Smile.svg"
14
+ }
15
+
16
+ }