From 7b67d50296a5687d6ea33c3737588dc70a8d3f53 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Mar 2021 11:15:41 +0000 Subject: [PATCH 1/2] Command alternatives --- notifications_client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index ddd7e2d3c..b3eb21b24 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -580,7 +580,8 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, screenreader, systemLanguage, espeak) print('') elif (keyPress == 'repeat' or keyPress == 'replay' or - keyPress == 'rp'): + keyPress == 'rp' or keyPress == 'again' or + keyPress == 'say again'): if screenreader and nameStr and \ gender and messageStr and content: sayStr = 'Repeating ' + nameStr @@ -592,12 +593,16 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, systemLanguage, espeak, nameStr, gender) print('') - elif keyPress == 'sounds on' or keyPress == 'sound': + elif (keyPress == 'sounds on' or + keyPress == 'sound on' or + keyPress == 'sound'): sayStr = 'Notification sounds on' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) notificationSounds = True - elif keyPress == 'sounds off' or keyPress == 'nosound': + elif (keyPress == 'sounds off' or + keyPress == 'sound off' or + keyPress == 'nosound'): sayStr = 'Notification sounds off' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) From 677b68c6eac0c6acd7f6f096edae9beea5e444b6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Mar 2021 11:35:03 +0000 Subject: [PATCH 2/2] Handle youtube links --- speaker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/speaker.py b/speaker.py index fef271773..ce87160b0 100644 --- a/speaker.py +++ b/speaker.py @@ -168,12 +168,14 @@ def speakerReplaceLinks(sayText: str, translate: {}, linkedStr = 'Linked' prevWord = '' for word in wordsList: + if word.startswith('v='): + replacements[word] = '' if word.startswith(':'): if word.endswith(':'): replacements[word] = ', emowji ' + word.replace(':', '') + ',' continue - # replace mentions, but not re-tweets if word.startswith('@') and not prevWord.endswith('RT'): + # replace mentions, but not re-tweets if translate.get('mentioning'): replacements[word] = \ translate['mentioning'] + ' ' + word[1:] + ', '