Skip to content

Commit 8c6b7a8

Browse files
committed
Set UI to trigger even when failed to reach server
Add connection restart wav files for indicators Remove timeout and timeout extensions Reduce latency in response Cleanup unwanted objects
1 parent 6471ed9 commit 8c6b7a8

24 files changed

+179
-309
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ if __name__ == '__main__':
3131
### Optional Env Vars
3232
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
3333
<br><br>
34-
- **REQUEST_TIMEOUT**: Defaults to `5` - _Timeout for API calls_
35-
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `5` for Windows - _Timeout for speech synthesis_
34+
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_
3635
<br><br>
3736
- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_
3837
- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_
@@ -44,12 +43,6 @@ if __name__ == '__main__':
4443
<br><br>
4544
- **VOICE_TIMEOUT**: Defaults to `3` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_
4645
- **VOICE_PHRASE_LIMIT**: Defaults to `None` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_
47-
<br><br>
48-
- **RESTART_TIMER**: Defaults to 24 hours.
49-
- I have a proxy tunneling my `localhost` from Jarvis server.
50-
- I have a CDN setup that's allowing me to access the tunnel with a custom domain.
51-
- Since I don't want my CDN to take the hit, and the tunnel origin changes often, I'm swapping the URL upon startup.
52-
- This requires restarting the UI every now and then.
5346

5447
**Custom settings for speech recognition**
5548

doc_generator/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ Exceptions
109109
:members:
110110
:undoc-members:
111111

112+
Display
113+
=======
114+
115+
.. automodule:: jarvis_ui.executables.display
116+
:members:
117+
:undoc-members:
118+
112119
Indices and tables
113120
==================
114121

docs/README.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ <h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Perm
7676
<ul class="simple">
7777
<li><p><strong>DEBUG</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code> - <em>Enable debug level logging</em>
7878
<br><br></p></li>
79-
<li><p><strong>REQUEST_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">5</span></code> - <em>Timeout for API calls</em></p></li>
80-
<li><p><strong>SPEECH_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> for macOS, <code class="docutils literal notranslate"><span class="pre">5</span></code> for Windows - <em>Timeout for speech synthesis</em>
79+
<li><p><strong>SPEECH_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> for macOS, <code class="docutils literal notranslate"><span class="pre">10</span></code> for Windows - <em>Timeout for speech synthesis</em>
8180
<br><br></p></li>
8281
<li><p><strong>NATIVE_AUDIO</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code> - <em>If set to <code class="docutils literal notranslate"><span class="pre">True</span></code>, the response is generated in the server’s default voice</em></p></li>
8382
<li><p><strong>WAKE_WORDS</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">jarvis</span></code> (Defaults to <code class="docutils literal notranslate"><span class="pre">alexa</span></code> in macOS older than <code class="docutils literal notranslate"><span class="pre">10.14</span></code>) - <em>Wake words to initiate Jarvis</em></p></li>
@@ -88,16 +87,7 @@ <h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Perm
8887
<li><p><strong>VOICE_RATE</strong>: Defaults to the value from <code class="docutils literal notranslate"><span class="pre">pyttsx3</span></code> module - <em>Speed/rate at which the text should be spoken</em>
8988
<br><br></p></li>
9089
<li><p><strong>VOICE_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">3</span></code> - <em>Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit</em></p></li>
91-
<li><p><strong>VOICE_PHRASE_LIMIT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> - <em>Timeout for phrase once listener is activated - Listener will be deactivated after this limit</em>
92-
<br><br></p></li>
93-
<li><p><strong>RESTART_TIMER</strong>: Defaults to 24 hours.</p>
94-
<ul>
95-
<li><p>I have a proxy tunneling my <code class="docutils literal notranslate"><span class="pre">localhost</span></code> from Jarvis server.</p></li>
96-
<li><p>I have a CDN setup that’s allowing me to access the tunnel with a custom domain.</p></li>
97-
<li><p>Since I don’t want my CDN to take the hit, and the tunnel origin changes often, I’m swapping the URL upon startup.</p></li>
98-
<li><p>This requires restarting the UI every now and then.</p></li>
99-
</ul>
100-
</li>
90+
<li><p><strong>VOICE_PHRASE_LIMIT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> - <em>Timeout for phrase once listener is activated - Listener will be deactivated after this limit</em></p></li>
10191
</ul>
10292
<p><strong>Custom settings for speech recognition</strong></p>
10393
<p>These are customized according to the author’s voice pitch.

docs/_sources/README.md.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ if __name__ == '__main__':
3131
### Optional Env Vars
3232
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
3333
<br><br>
34-
- **REQUEST_TIMEOUT**: Defaults to `5` - _Timeout for API calls_
35-
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `5` for Windows - _Timeout for speech synthesis_
34+
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_
3635
<br><br>
3736
- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_
3837
- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_
@@ -44,12 +43,6 @@ if __name__ == '__main__':
4443
<br><br>
4544
- **VOICE_TIMEOUT**: Defaults to `3` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_
4645
- **VOICE_PHRASE_LIMIT**: Defaults to `None` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_
47-
<br><br>
48-
- **RESTART_TIMER**: Defaults to 24 hours.
49-
- I have a proxy tunneling my `localhost` from Jarvis server.
50-
- I have a CDN setup that's allowing me to access the tunnel with a custom domain.
51-
- Since I don't want my CDN to take the hit, and the tunnel origin changes often, I'm swapping the URL upon startup.
52-
- This requires restarting the UI every now and then.
5346

5447
**Custom settings for speech recognition**
5548

docs/_sources/index.rst.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ Exceptions
109109
:members:
110110
:undoc-members:
111111

112+
Display
113+
=======
114+
115+
.. automodule:: jarvis_ui.executables.display
116+
:members:
117+
:undoc-members:
118+
112119
Indices and tables
113120
==================
114121

docs/genindex.html

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,13 @@ <h2 id="C">C</h2>
9898
</li>
9999
<li><a href="index.html#jarvis_ui.modules.peripherals.ChannelType">ChannelType (class in jarvis_ui.modules.peripherals)</a>
100100
</li>
101-
</ul></td>
102-
<td style="width: 33%; vertical-align: top;"><ul>
103101
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.close">close() (jarvis_ui.modules.playsound.PlayAudio method)</a>
104102
</li>
103+
</ul></td>
104+
<td style="width: 33%; vertical-align: top;"><ul>
105105
<li><a href="index.html#jarvis_ui.modules.config.Config">Config (class in jarvis_ui.modules.config)</a>
106+
</li>
107+
<li><a href="index.html#jarvis_ui.modules.models.FileIO.connection_restart">connection_restart (jarvis_ui.modules.models.FileIO attribute)</a>
106108
</li>
107109
<li><a href="index.html#jarvis_ui.modules.logger.console_logger">console_logger() (in module jarvis_ui.modules.logger)</a>
108110
</li>
@@ -146,7 +148,7 @@ <h2 id="F">F</h2>
146148
<td style="width: 33%; vertical-align: top;"><ul>
147149
<li><a href="index.html#jarvis_ui.modules.models.FileIO">FileIO (class in jarvis_ui.modules.models)</a>
148150
</li>
149-
<li><a href="index.html#jarvis_ui.modules.models.Flag">Flag (class in jarvis_ui.modules.models)</a>
151+
<li><a href="index.html#jarvis_ui.executables.display.flush_screen">flush_screen() (in module jarvis_ui.executables.display)</a>
150152
</li>
151153
</ul></td>
152154
</tr></table>
@@ -181,6 +183,13 @@ <h2 id="J">J</h2>
181183

182184
<ul>
183185
<li><a href="index.html#module-jarvis_ui.executables.api_handler">module</a>
186+
</li>
187+
</ul></li>
188+
<li>
189+
jarvis_ui.executables.display
190+
191+
<ul>
192+
<li><a href="index.html#module-jarvis_ui.executables.display">module</a>
184193
</li>
185194
</ul></li>
186195
<li>
@@ -204,15 +213,15 @@ <h2 id="J">J</h2>
204213
<li><a href="index.html#module-jarvis_ui.executables.starter">module</a>
205214
</li>
206215
</ul></li>
216+
</ul></td>
217+
<td style="width: 33%; vertical-align: top;"><ul>
207218
<li>
208219
jarvis_ui.main
209220

210221
<ul>
211222
<li><a href="index.html#module-jarvis_ui.main">module</a>
212223
</li>
213224
</ul></li>
214-
</ul></td>
215-
<td style="width: 33%; vertical-align: top;"><ul>
216225
<li>
217226
jarvis_ui.modules.exceptions
218227

@@ -268,6 +277,8 @@ <h2 id="M">M</h2>
268277

269278
<ul>
270279
<li><a href="index.html#module-jarvis_ui.executables.api_handler">jarvis_ui.executables.api_handler</a>
280+
</li>
281+
<li><a href="index.html#module-jarvis_ui.executables.display">jarvis_ui.executables.display</a>
271282
</li>
272283
<li><a href="index.html#module-jarvis_ui.executables.listener">jarvis_ui.executables.listener</a>
273284
</li>
@@ -348,22 +359,12 @@ <h2 id="R">R</h2>
348359
</li>
349360
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.request_url">request_url (jarvis_ui.modules.models.EnvConfig attribute)</a>
350361
</li>
351-
<li><a href="index.html#jarvis_ui.modules.models.FileIO.restart">restart (jarvis_ui.modules.models.FileIO attribute)</a>
352-
353-
<ul>
354-
<li><a href="index.html#jarvis_ui.modules.models.Flag.restart">(jarvis_ui.modules.models.Flag attribute)</a>
355-
</li>
356-
</ul></li>
357362
</ul></td>
358363
<td style="width: 33%; vertical-align: top;"><ul>
359-
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.restart_attempts">restart_attempts (jarvis_ui.modules.models.EnvConfig attribute)</a>
364+
<li><a href="index.html#jarvis_ui.modules.models.FileIO.restart">restart (jarvis_ui.modules.models.FileIO attribute)</a>
360365
</li>
361-
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.restart_timer">restart_timer (jarvis_ui.modules.models.EnvConfig attribute)</a>
362-
363-
<ul>
364-
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer.restart_timer">(jarvis_ui.modules.models.RestartTimer attribute)</a>
366+
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer.restart_timer">restart_timer (jarvis_ui.modules.models.RestartTimer attribute)</a>
365367
</li>
366-
</ul></li>
367368
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer">RestartTimer (class in jarvis_ui.modules.models)</a>
368369
</li>
369370
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.run">run() (jarvis_ui.modules.playsound.PlayAudio method)</a>
@@ -385,11 +386,11 @@ <h2 id="S">S</h2>
385386
</li>
386387
</ul></li>
387388
<li><a href="index.html#jarvis_ui.modules.models.Settings">Settings (class in jarvis_ui.modules.models)</a>
388-
</li>
389-
<li><a href="index.html#jarvis_ui.modules.models.FileIO.shutdown">shutdown (jarvis_ui.modules.models.FileIO attribute)</a>
390389
</li>
391390
</ul></td>
392391
<td style="width: 33%; vertical-align: top;"><ul>
392+
<li><a href="index.html#jarvis_ui.modules.models.FileIO.shutdown">shutdown (jarvis_ui.modules.models.FileIO attribute)</a>
393+
</li>
393394
<li><a href="index.html#jarvis_ui.executables.speaker.speak">speak() (in module jarvis_ui.executables.speaker)</a>
394395
</li>
395396
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.speech_timeout">speech_timeout (jarvis_ui.modules.models.EnvConfig attribute)</a>
@@ -402,8 +403,6 @@ <h2 id="S">S</h2>
402403
<li><a href="index.html#jarvis_ui.executables.starter.Activator.start">(jarvis_ui.executables.starter.Activator method)</a>
403404
</li>
404405
</ul></li>
405-
<li><a href="index.html#jarvis_ui.modules.models.Flag.stop">stop (jarvis_ui.modules.models.Flag attribute)</a>
406-
</li>
407406
</ul></td>
408407
</tr></table>
409408

@@ -451,11 +450,11 @@ <h2 id="W">W</h2>
451450
<table style="width: 100%" class="indextable genindextable"><tr>
452451
<td style="width: 33%; vertical-align: top;"><ul>
453452
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.wake_words">wake_words (jarvis_ui.modules.models.EnvConfig attribute)</a>
454-
455-
<ul>
456-
<li><a href="index.html#jarvis_ui.modules.models.Settings.wake_words">(jarvis_ui.modules.models.Settings attribute)</a>
457453
</li>
458-
</ul></li>
454+
</ul></td>
455+
<td style="width: 33%; vertical-align: top;"><ul>
456+
<li><a href="index.html#jarvis_ui.executables.display.write_screen">write_screen() (in module jarvis_ui.executables.display)</a>
457+
</li>
459458
</ul></td>
460459
</tr></table>
461460

0 commit comments

Comments
 (0)