From c486d565355dceeaa80175edbc1ad849eeae6161 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 9 Mar 2021 21:29:02 +0000 Subject: [PATCH] Only echo to screen if screen reader is active --- notifications_client.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 2073ed9a4..606aabadf 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -218,18 +218,20 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, # append image description if needed if not speakerJson.get('imageDescription'): sayStr = speakerJson['say'] - # echo spoken text to the screen - print(html.unescape(nameStr) + ': ' + - html.unescape(speakerJson['say']) + '\n') + if screenreader: + # echo spoken text to the screen + print(html.unescape(nameStr) + ': ' + + html.unescape(speakerJson['say']) + '\n') else: sayStr = speakerJson['say'] + '. ' + \ speakerJson['imageDescription'] # echo spoken text to the screen imageDescription = \ html.unescape(speakerJson['imageDescription']) - print(html.unescape(nameStr) + ': ' + - html.unescape(speakerJson['say']) + '\n' + - imageDescription) + if screenreader: + print(html.unescape(nameStr) + ': ' + + html.unescape(speakerJson['say']) + + '\n' + imageDescription) # speak the post content if screenreader == 'espeak':