ovos-skill-naptime 0.3.1__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 (107) hide show
  1. ovos-skill-naptime-0.3.1/LICENSE +202 -0
  2. ovos-skill-naptime-0.3.1/MANIFEST.in +7 -0
  3. ovos-skill-naptime-0.3.1/PKG-INFO +60 -0
  4. ovos-skill-naptime-0.3.1/README.md +48 -0
  5. ovos-skill-naptime-0.3.1/__init__.py +211 -0
  6. ovos-skill-naptime-0.3.1/locale/ca-es/SleepCommand.voc +2 -0
  7. ovos-skill-naptime-0.3.1/locale/ca-es/going.to.sleep.dialog +3 -0
  8. ovos-skill-naptime-0.3.1/locale/ca-es/going.to.sleep.short.dialog +2 -0
  9. ovos-skill-naptime-0.3.1/locale/ca-es/i.am.awake.dialog +1 -0
  10. ovos-skill-naptime-0.3.1/locale/ca-es/naptime.intent +27 -0
  11. ovos-skill-naptime-0.3.1/locale/cs-cz/SleepCommand.voc +3 -0
  12. ovos-skill-naptime-0.3.1/locale/cs-cz/going.to.sleep.dialog +3 -0
  13. ovos-skill-naptime-0.3.1/locale/cs-cz/going.to.sleep.short.dialog +2 -0
  14. ovos-skill-naptime-0.3.1/locale/cs-cz/i.am.awake.dialog +1 -0
  15. ovos-skill-naptime-0.3.1/locale/de-de/SleepCommand.voc +2 -0
  16. ovos-skill-naptime-0.3.1/locale/de-de/going.to.sleep.dialog +3 -0
  17. ovos-skill-naptime-0.3.1/locale/de-de/going.to.sleep.short.dialog +2 -0
  18. ovos-skill-naptime-0.3.1/locale/de-de/i.am.awake.dialog +1 -0
  19. ovos-skill-naptime-0.3.1/locale/de-de/naptime.intent +40 -0
  20. ovos-skill-naptime-0.3.1/locale/el-gr/going.to.sleep.dialog +3 -0
  21. ovos-skill-naptime-0.3.1/locale/el-gr/going.to.sleep.short.dialog +2 -0
  22. ovos-skill-naptime-0.3.1/locale/el-gr/i.am.awake.dialog +1 -0
  23. ovos-skill-naptime-0.3.1/locale/en-us/going.to.sleep.dialog +3 -0
  24. ovos-skill-naptime-0.3.1/locale/en-us/going.to.sleep.short.dialog +2 -0
  25. ovos-skill-naptime-0.3.1/locale/en-us/i.am.awake.dialog +1 -0
  26. ovos-skill-naptime-0.3.1/locale/en-us/naptime.intent +31 -0
  27. ovos-skill-naptime-0.3.1/locale/es-es/SleepCommand.voc +2 -0
  28. ovos-skill-naptime-0.3.1/locale/es-es/going.to.sleep.dialog +3 -0
  29. ovos-skill-naptime-0.3.1/locale/es-es/going.to.sleep.short.dialog +2 -0
  30. ovos-skill-naptime-0.3.1/locale/es-es/i.am.awake.dialog +1 -0
  31. ovos-skill-naptime-0.3.1/locale/eu-eu/SleepCommand.voc +3 -0
  32. ovos-skill-naptime-0.3.1/locale/eu-eu/going.to.sleep.dialog +2 -0
  33. ovos-skill-naptime-0.3.1/locale/eu-eu/going.to.sleep.short.dialog +3 -0
  34. ovos-skill-naptime-0.3.1/locale/eu-eu/i.am.awake.dialog +3 -0
  35. ovos-skill-naptime-0.3.1/locale/fa-ir/SleepCommand.voc +2 -0
  36. ovos-skill-naptime-0.3.1/locale/fa-ir/going.to.sleep.dialog +3 -0
  37. ovos-skill-naptime-0.3.1/locale/fa-ir/going.to.sleep.short.dialog +2 -0
  38. ovos-skill-naptime-0.3.1/locale/fa-ir/i.am.awake.dialog +1 -0
  39. ovos-skill-naptime-0.3.1/locale/fr-fr/SleepCommand.voc +2 -0
  40. ovos-skill-naptime-0.3.1/locale/fr-fr/going.to.sleep.dialog +3 -0
  41. ovos-skill-naptime-0.3.1/locale/fr-fr/going.to.sleep.short.dialog +2 -0
  42. ovos-skill-naptime-0.3.1/locale/fr-fr/i.am.awake.dialog +1 -0
  43. ovos-skill-naptime-0.3.1/locale/gl-es/SleepCommand.voc +2 -0
  44. ovos-skill-naptime-0.3.1/locale/gl-es/going.to.sleep.dialog +3 -0
  45. ovos-skill-naptime-0.3.1/locale/gl-es/going.to.sleep.short.dialog +2 -0
  46. ovos-skill-naptime-0.3.1/locale/gl-es/i.am.awake.dialog +1 -0
  47. ovos-skill-naptime-0.3.1/locale/hu-hu/SleepCommand.voc +4 -0
  48. ovos-skill-naptime-0.3.1/locale/hu-hu/going.to.sleep.dialog +3 -0
  49. ovos-skill-naptime-0.3.1/locale/hu-hu/going.to.sleep.short.dialog +1 -0
  50. ovos-skill-naptime-0.3.1/locale/hu-hu/i.am.awake.dialog +1 -0
  51. ovos-skill-naptime-0.3.1/locale/it-it/SleepCommand.voc +2 -0
  52. ovos-skill-naptime-0.3.1/locale/it-it/going.to.sleep.dialog +2 -0
  53. ovos-skill-naptime-0.3.1/locale/it-it/going.to.sleep.short.dialog +2 -0
  54. ovos-skill-naptime-0.3.1/locale/it-it/i.am.awake.dialog +1 -0
  55. ovos-skill-naptime-0.3.1/locale/it-it/naptime.intent +3 -0
  56. ovos-skill-naptime-0.3.1/locale/nl-nl/SleepCommand.voc +2 -0
  57. ovos-skill-naptime-0.3.1/locale/nl-nl/going.to.sleep.dialog +3 -0
  58. ovos-skill-naptime-0.3.1/locale/nl-nl/going.to.sleep.short.dialog +2 -0
  59. ovos-skill-naptime-0.3.1/locale/nl-nl/i.am.awake.dialog +1 -0
  60. ovos-skill-naptime-0.3.1/locale/pl-pl/SleepCommand.voc +2 -0
  61. ovos-skill-naptime-0.3.1/locale/pl-pl/going.to.sleep.dialog +3 -0
  62. ovos-skill-naptime-0.3.1/locale/pl-pl/going.to.sleep.short.dialog +2 -0
  63. ovos-skill-naptime-0.3.1/locale/pl-pl/i.am.awake.dialog +1 -0
  64. ovos-skill-naptime-0.3.1/locale/pt-br/SleepCommand.voc +2 -0
  65. ovos-skill-naptime-0.3.1/locale/pt-br/going.to.sleep.dialog +3 -0
  66. ovos-skill-naptime-0.3.1/locale/pt-br/going.to.sleep.short.dialog +2 -0
  67. ovos-skill-naptime-0.3.1/locale/pt-br/i.am.awake.dialog +1 -0
  68. ovos-skill-naptime-0.3.1/locale/pt-pt/SleepCommand.voc +2 -0
  69. ovos-skill-naptime-0.3.1/locale/pt-pt/going.to.sleep.dialog +3 -0
  70. ovos-skill-naptime-0.3.1/locale/pt-pt/going.to.sleep.short.dialog +2 -0
  71. ovos-skill-naptime-0.3.1/locale/pt-pt/i.am.awake.dialog +1 -0
  72. ovos-skill-naptime-0.3.1/locale/pt-pt/naptime.intent +9 -0
  73. ovos-skill-naptime-0.3.1/locale/ro-ro/SleepCommand.voc +2 -0
  74. ovos-skill-naptime-0.3.1/locale/ro-ro/going.to.sleep.dialog +3 -0
  75. ovos-skill-naptime-0.3.1/locale/ro-ro/going.to.sleep.short.dialog +2 -0
  76. ovos-skill-naptime-0.3.1/locale/ro-ro/i.am.awake.dialog +1 -0
  77. ovos-skill-naptime-0.3.1/locale/ru-ru/SleepCommand.voc +2 -0
  78. ovos-skill-naptime-0.3.1/locale/ru-ru/going.to.sleep.dialog +3 -0
  79. ovos-skill-naptime-0.3.1/locale/ru-ru/going.to.sleep.short.dialog +2 -0
  80. ovos-skill-naptime-0.3.1/locale/ru-ru/i.am.awake.dialog +1 -0
  81. ovos-skill-naptime-0.3.1/locale/sv-se/SleepCommand.voc +2 -0
  82. ovos-skill-naptime-0.3.1/locale/sv-se/going.to.sleep.dialog +3 -0
  83. ovos-skill-naptime-0.3.1/locale/sv-se/going.to.sleep.short.dialog +2 -0
  84. ovos-skill-naptime-0.3.1/locale/sv-se/i.am.awake.dialog +1 -0
  85. ovos-skill-naptime-0.3.1/locale/tr-tr/SleepCommand.voc +2 -0
  86. ovos-skill-naptime-0.3.1/locale/tr-tr/going.to.sleep.dialog +3 -0
  87. ovos-skill-naptime-0.3.1/locale/tr-tr/going.to.sleep.short.dialog +2 -0
  88. ovos-skill-naptime-0.3.1/locale/tr-tr/i.am.awake.dialog +1 -0
  89. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/PKG-INFO +60 -0
  90. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/SOURCES.txt +105 -0
  91. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/dependency_links.txt +1 -0
  92. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/entry_points.txt +3 -0
  93. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/requires.txt +3 -0
  94. ovos-skill-naptime-0.3.1/ovos_skill_naptime.egg-info/top_level.txt +1 -0
  95. ovos-skill-naptime-0.3.1/requirements.txt +3 -0
  96. ovos-skill-naptime-0.3.1/res/desktop/skill.json +40 -0
  97. ovos-skill-naptime-0.3.1/setup.cfg +4 -0
  98. ovos-skill-naptime-0.3.1/setup.py +93 -0
  99. ovos-skill-naptime-0.3.1/ui/Face.qml +133 -0
  100. ovos-skill-naptime-0.3.1/ui/awake.qml +16 -0
  101. ovos-skill-naptime-0.3.1/ui/face/Eyeball.svg +3 -0
  102. ovos-skill-naptime-0.3.1/ui/face/GreySmile.svg +3 -0
  103. ovos-skill-naptime-0.3.1/ui/face/Smile.svg +3 -0
  104. ovos-skill-naptime-0.3.1/ui/face/lid.svg +3 -0
  105. ovos-skill-naptime-0.3.1/ui/face/upper-lid.svg +3 -0
  106. ovos-skill-naptime-0.3.1/ui/resting.qml +16 -0
  107. ovos-skill-naptime-0.3.1/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,7 @@
1
+ recursive-include dialog *
2
+ recursive-include vocab *
3
+ recursive-include locale *
4
+ recursive-include res *
5
+ recursive-include ui *
6
+ include *.json
7
+ include *.txt
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.1
2
+ Name: ovos-skill-naptime
3
+ Version: 0.3.1
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,211 @@
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.skills import OVOSSkill
23
+
24
+
25
+ class NapTimeSkill(OVOSSkill):
26
+ """Skill to handle mycroft speech client listener sleeping."""
27
+
28
+ @classproperty
29
+ def runtime_requirements(self):
30
+ return RuntimeRequirements(
31
+ internet_before_load=False,
32
+ network_before_load=False,
33
+ gui_before_load=False,
34
+ requires_internet=False,
35
+ requires_network=False,
36
+ requires_gui=False,
37
+ no_internet_fallback=True,
38
+ no_network_fallback=True,
39
+ no_gui_fallback=True,
40
+ )
41
+
42
+ def initialize(self):
43
+ self.started_by_skill = False
44
+ self.sleeping = False
45
+ self.old_brightness = 30
46
+ self.add_event("mycroft.awoken", self.handle_awoken)
47
+ self.add_event("mycroft.awoken", self.mark1_wake_up_animation)
48
+ self.add_event("recognizer_loop:sleep", self.mark1_sleep_animation)
49
+ self.add_event("mycroft.awoken", self.display_waking_face)
50
+ self.add_event("recognizer_loop:sleep", self.display_sleep_face)
51
+ self.disabled_confirm_listening = False
52
+
53
+ @property
54
+ def mute(self):
55
+ return self.settings.get("mute", False)
56
+
57
+ @property
58
+ def wake_word(self):
59
+ default = Configuration().get("listener", {}).get("wake_word")
60
+ # with multiple wakewords we can't be 100% sure what the correct name is
61
+ # a device might have multiple names
62
+ # - if the wake_word is set in listener consider that the main wakeword
63
+ # - if the wake_word in listener config does not have a ww config ignore it
64
+ # - else use the first hotword that listens and is set to self.lang, assume config is
65
+ # ordered by priority
66
+ # - else use the first hotword that listens, assume config is ordered by priority
67
+
68
+ hotwords = Configuration().get("hotwords", {})
69
+ if default in hotwords:
70
+ return default
71
+
72
+ # gather hotwords that trigger listening
73
+ candidates = {}
74
+ for ww_name, ww_conf in hotwords.items():
75
+ if ww_conf.get("listen"):
76
+ candidates[ww_name] = ww_conf
77
+
78
+ if candidates:
79
+ # preference to main language
80
+ for ww_name, ww_conf in candidates.items():
81
+ if ww_conf.get("lang", "") == self.lang:
82
+ return ww_name
83
+ # assume ordered by preference in config
84
+ return candidates[0]
85
+ return default
86
+
87
+ # TODO move mark1 handlers to PHAL mk1 plugin
88
+ def mark1_sleep_animation(self, message: Message):
89
+ time.sleep(0.5)
90
+ # Dim and look downward to 'go to sleep'
91
+ # TODO: Get current brightness from somewhere
92
+ self.old_brightness = 30
93
+ for i in range(0, (self.old_brightness - 10) // 2):
94
+ self.enclosure.eyes_brightness(self.old_brightness - i * 2)
95
+ time.sleep(0.15)
96
+ self.enclosure.eyes_look("d")
97
+
98
+ def mark1_wake_up_animation(self, message: Message):
99
+ """Mild animation to come out of sleep from voice command.
100
+
101
+ Pop open eyes and wait a sec.
102
+ """
103
+ self.enclosure.eyes_reset()
104
+ time.sleep(1)
105
+ self.enclosure.eyes_blink("b")
106
+ time.sleep(1)
107
+ # brighten the rest of the way
108
+ self.enclosure.eyes_brightness(self.old_brightness)
109
+
110
+ # GUI integration
111
+ def display_sleep_face(self) -> None:
112
+ """Display the sleeping face depending on the platform."""
113
+ self.gui.show_page("resting.qml", override_idle=True)
114
+
115
+ def display_waking_face(self) -> None:
116
+ """Display the waking face depending on the platform."""
117
+ self.gui.remove_page("resting.qml")
118
+ self.gui.show_page("awake.qml", override_idle=5)
119
+ # TODO Screen not reverting after the specified 5 seconds.
120
+ # The following 2 lines shouldn't be needed. Remove when fixed.
121
+ time.sleep(5)
122
+ self.gui.release()
123
+
124
+ # TODO notifications api not yet merged
125
+ # merge this into ovos_workshop
126
+ def show_notification(self, content, action=None, noticetype="transient"):
127
+ """Display a Notification on homepage in the GUI.
128
+ Arguments:
129
+ content (str): Main text content of a notification, Limited
130
+ to two visual lines.
131
+ action (str): Callback to any event registered by the skill
132
+ to perform a certain action when notification is
133
+ clicked.
134
+ noticetype (str):
135
+ transient: 'Default' displays a notification with a timeout.
136
+ sticky: displays a notification that sticks to the screen.
137
+ """
138
+ self.bus.emit(
139
+ Message(
140
+ "homescreen.notification.set",
141
+ data={
142
+ "sender": self.skill_id,
143
+ "text": content,
144
+ "action": action,
145
+ "type": noticetype,
146
+ },
147
+ )
148
+ )
149
+
150
+ def handle_speak(self, message: Message):
151
+ if self.sleeping:
152
+ utt = message.data["utterance"]
153
+ self.show_notification(utt)
154
+
155
+ @intent_handler("naptime.intent")
156
+ def handle_go_to_sleep(self, message: Message):
157
+ """Sends a message to the speech client putting the listener to sleep.
158
+
159
+ If the user has been told about the waking up process five times
160
+ already, it sends a shorter message.
161
+ """
162
+ if self.wake_word:
163
+ self.speak_dialog(
164
+ "going.to.sleep", {"wake_word": self.wake_word}, wait=True
165
+ )
166
+ else:
167
+ self.speak_dialog("going.to.sleep.short", wait=True)
168
+
169
+ self.bus.emit(Message("recognizer_loop:sleep"))
170
+ self.sleeping = True
171
+ self.started_by_skill = True
172
+ if self.mute:
173
+ self.bus.emit(Message("mycroft.volume.mute"))
174
+ if self.config_core["confirm_listening"]:
175
+ self.disable_confirm_listening()
176
+
177
+ def handle_awoken(self, message: Message):
178
+ """Handler for the mycroft.awoken message
179
+
180
+ The message is sent when the listener hears 'Hey Mycroft, Wake Up',
181
+ this handles the user interaction upon wake up.
182
+ """
183
+ started_by_skill = self.started_by_skill
184
+ self.awaken()
185
+ if started_by_skill:
186
+ # Announce that the unit is awake
187
+ self.speak_dialog("i.am.awake", wait=True)
188
+
189
+ def awaken(self):
190
+ if self.mute:
191
+ self.bus.emit(Message("mycroft.volume.unmute"))
192
+ if self.disabled_confirm_listening:
193
+ self.enable_confirm_listening()
194
+ self.sleeping = False
195
+ self.started_by_skill = False
196
+
197
+ def disable_confirm_listening(self):
198
+ msg = Message(
199
+ "configuration.patch", data={"config": {"confirm_listening": False}}
200
+ )
201
+ self.bus.emit(msg)
202
+ self.disabled_confirm_listening = True
203
+ self.log.info("Disabled listen sound")
204
+
205
+ def enable_confirm_listening(self):
206
+ msg = Message(
207
+ "configuration.patch", data={"config": {"confirm_listening": True}}
208
+ )
209
+ self.bus.emit(msg)
210
+ self.disabled_confirm_listening = False
211
+ self.log.info("Enabled listen sound")
@@ -0,0 +1,2 @@
1
+ hora de la siesta
2
+ ves a dormir
@@ -0,0 +1,3 @@
1
+ D'acord, vaig a dormir. Podeu despertar-me dient '{wake_word}, desperta'.
2
+ Vaig a dormir ara. Digueu '{wake_word}, desperta' per aixecar-me.
3
+ Vaig a dormir. Digueu '{wake_word}, desperta' per tornar a cridar la meva atenció.
@@ -0,0 +1,2 @@
1
+ D'acord.
2
+ Vaig a dormir.
@@ -0,0 +1 @@
1
+ Estic despert
@@ -0,0 +1,27 @@
1
+ a dormir
2
+ a fer la migdiada
3
+ activa el mode adormit
4
+ anem a dormir
5
+ comença a dormir
6
+ comença el període de migdiada
7
+ comença el temps d'inactivitat
8
+ comença el temps de dormir
9
+ comença l'interval de son
10
+ comença la migdiada
11
+ entra al país dels somnis
12
+ entra en mode de (repòs|descans)
13
+ entra en mode de somni
14
+ entra en mode silenci
15
+ hora de (la|sa) migdiada
16
+ hora de dormir
17
+ inicia (la|sa) migdiada
18
+ inicia el mode de descans
19
+ inicia el mode de repòs
20
+ inicia el mode migdiada
21
+ inicia el tancament dels ulls
22
+ inicia la migdiada
23
+ inicia la sessió de son
24
+ inicia un temps tranquil
25
+ passem una estona tranquil·la
26
+ ves a hibernació
27
+ ves al mode adormit
@@ -0,0 +1,3 @@
1
+ běž spát
2
+ jdi spát
3
+ čas na šlofíka
@@ -0,0 +1,3 @@
1
+ Dobře, jdu teda spát. Můžeš mě probudit vyslovením '{wake_word}, probuď se'.
2
+ Jdu spát. Řekni '{wake_word}, probuď se' aby jsi znovu získal mou pozornost.
3
+ Teď jdu spát. Řekni '{wake_word}, probuď se' abych se probral.
@@ -0,0 +1,2 @@
1
+ Jdu spát.
2
+ Okay.
@@ -0,0 +1 @@
1
+ Jsem vzhůru
@@ -0,0 +1,2 @@
1
+ Geh schlafen
2
+ Schlafenszeit
@@ -0,0 +1,3 @@
1
+ Ich gehe jetzt schlafen. Sage '{wake_word}, wach auf' um mich aufzuwecken.
2
+ Ich gehe schlafen. Sage '{wake_word}, wach auf' damit ich wieder zuhöre.
3
+ Okay, gehe schlafen. Du kannst mich wecken, indem du '{wake_word}, wach auf' sagst.
@@ -0,0 +1,2 @@
1
+ Gehe schlafen.
2
+ Okay.
@@ -0,0 +1 @@
1
+ ich bin wieder wach
@@ -0,0 +1,40 @@
1
+ Begin Downtime
2
+ Beginne Mittagsruhe
3
+ Beginne Powernap
4
+ Beginne Siesta
5
+ Beginne mit dem Mittagsschlaf
6
+ Gib uns eine Ruhezeit
7
+ Mache ein Nickerchen machen
8
+ Mach ein Nickerchen machen
9
+ Mittagsschlaf
10
+ Mittagsschlaf einleiten
11
+ Nickerchen beginnen
12
+ Schlaf einleiten
13
+ Schlafintervall beginnen
14
+ Schlafmodus aktivieren
15
+ Schlummermodus starten
16
+ starte Schlummermodus
17
+ Siesta-Modus starten
18
+ starte Siesta-Modus
19
+ Starte Schlummerzeit
20
+ Zeit für ein Nickerchen
21
+ Zeit zum Schlafen
22
+ betrete das Traumland
23
+ fang an einzudösen
24
+ fang an zu schlafen
25
+ geh schlafen
26
+ gehe schlafen
27
+ gehe schlafen
28
+ in den Lautlos-Modus wechseln
29
+ wechsel in den Lautlos-Modus
30
+ wechsele in den Lautlos-Modus
31
+ in den Schlafmodus wechseln
32
+ starte Ruhezeit
33
+ starte Schlafmodus
34
+ starte sleep session
35
+ wechsel in den Ruhemodus
36
+ wechsele in den Ruhemodus
37
+ wechsele in den Ruhemodus
38
+ wechsel in den Ruhemodus
39
+ wechsele in den Ruhezustand
40
+ wechsel in den Ruhezustand
@@ -0,0 +1,3 @@
1
+ Λοιπόν, πηγαίνω για ύπνο. Μπορείς να με σηκώσεις λέγοντας '{wake_word}, ξύπνα'.
2
+ Πέφτω για ύπνο τώρα. Πες '{wake_word}, ξύπνα' για να με ξυπνήσεις.
3
+ Πηγαίνω για ύπνο. Πες '{wake_word}, ξύπνα' για να έχεις την προσοχή μου και πάλι.
@@ -0,0 +1,2 @@
1
+ Εντάξει.
2
+ Πάω για ύπνο.
@@ -0,0 +1 @@
1
+ Ξύπνησα
@@ -0,0 +1,3 @@
1
+ Alright, going to sleep. You can rouse me by saying '{wake_word}, wake up'.
2
+ Going to sleep now. Say '{wake_word}, wake up' to get me up.
3
+ I'm going to sleep. Say '{wake_word}, wake up' to get my attention again.
@@ -0,0 +1,2 @@
1
+ Going to sleep.
2
+ Okay.