add announce and interrupt for autotime
This commit is contained in:
parent
2da9db37c0
commit
4dfa19ed72
@ -129,3 +129,8 @@ delaySec=0
|
|||||||
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
||||||
# if delaySec is >0 onMinutes is ignored
|
# if delaySec is >0 onMinutes is ignored
|
||||||
onMinutes=00,30
|
onMinutes=00,30
|
||||||
|
# announce via soundicon
|
||||||
|
announce=True
|
||||||
|
# interrupt current speech for time announcement
|
||||||
|
interrupt=False
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ list=
|
|||||||
|
|
||||||
[time]
|
[time]
|
||||||
# automatic time anouncement
|
# automatic time anouncement
|
||||||
enabled=False
|
enabled=True
|
||||||
# present time
|
# present time
|
||||||
presentTime=True
|
presentTime=True
|
||||||
# present date (on change)
|
# present date (on change)
|
||||||
@ -135,3 +135,7 @@ delaySec=0
|
|||||||
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
||||||
# if delaySec is >0 onMinutes is ignored
|
# if delaySec is >0 onMinutes is ignored
|
||||||
onMinutes=00,30
|
onMinutes=00,30
|
||||||
|
# announce via soundicon (not interrupting)
|
||||||
|
announce=True
|
||||||
|
# interrupt current speech for time announcement
|
||||||
|
interrupt=False
|
||||||
|
@ -135,3 +135,7 @@ delaySec=0
|
|||||||
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
||||||
# if delaySec is >0 onMinutes is ignored
|
# if delaySec is >0 onMinutes is ignored
|
||||||
onMinutes=00,30
|
onMinutes=00,30
|
||||||
|
# announce via soundicon
|
||||||
|
announce=True
|
||||||
|
# interrupt current speech for time announcement
|
||||||
|
interrupt=False
|
||||||
|
@ -85,3 +85,7 @@ delaySec=0
|
|||||||
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
# present time after to given minutes example every 15 minutes: 00,15,30,45
|
||||||
# if delaySec is >0 onMinutes is ignored
|
# if delaySec is >0 onMinutes is ignored
|
||||||
onMinutes=00,30
|
onMinutes=00,30
|
||||||
|
# announce via soundicon
|
||||||
|
announce=True
|
||||||
|
# interrupt current speech for time announcement
|
||||||
|
interrupt=False
|
||||||
|
Binary file not shown.
@ -48,3 +48,5 @@ PromotedText='PromotedText.wav'
|
|||||||
mispell='mispell.wav'
|
mispell='mispell.wav'
|
||||||
# the for capital letter
|
# the for capital letter
|
||||||
capital='Caps.wav'
|
capital='Caps.wav'
|
||||||
|
# general announcement
|
||||||
|
announce="Announce.wav"
|
||||||
|
Binary file not shown.
@ -48,3 +48,5 @@ PromotedText='PromotedText.opus'
|
|||||||
mispell='mispell.opus'
|
mispell='mispell.opus'
|
||||||
# the for capital letter
|
# the for capital letter
|
||||||
capital='Caps.opus'
|
capital='Caps.opus'
|
||||||
|
# general announcement
|
||||||
|
announce="Announce.opus"
|
||||||
|
@ -48,3 +48,5 @@ PromotedText=''
|
|||||||
mispell=''
|
mispell=''
|
||||||
# the for capital letter:
|
# the for capital letter:
|
||||||
capital=''
|
capital=''
|
||||||
|
# general announcement
|
||||||
|
announce=""
|
||||||
|
@ -44,18 +44,28 @@ class command():
|
|||||||
if now.hour == self.lastTime.hour:
|
if now.hour == self.lastTime.hour:
|
||||||
if now.minute == self.lastTime.minute:
|
if now.minute == self.lastTime.minute:
|
||||||
return
|
return
|
||||||
|
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
||||||
|
dateString = datetime.datetime.strftime(now, dateFormat)
|
||||||
|
|
||||||
|
presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \
|
||||||
|
self.lastDateString != dateString
|
||||||
|
presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime')
|
||||||
|
# no changed value to announce
|
||||||
|
if not (presentDate or presentTime):
|
||||||
|
return
|
||||||
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
||||||
timeString = datetime.datetime.strftime(now, timeFormat)
|
timeString = datetime.datetime.strftime(now, timeFormat)
|
||||||
|
|
||||||
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'):
|
||||||
dateString = datetime.datetime.strftime(now, dateFormat)
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'):
|
||||||
|
self.env['runtime']['outputManager'].playSoundIcon('announce')
|
||||||
|
|
||||||
|
if presentTime:
|
||||||
# present the time
|
# present the time
|
||||||
self.env['runtime']['outputManager'].presentText('Autotime: ' + timeString , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText('Autotime: ' + timeString , soundIcon='', interrupt=False)
|
||||||
# and date if changes
|
# and date if changes
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate'):
|
if presentDate:
|
||||||
if self.lastDateString != dateString:
|
|
||||||
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)
|
||||||
self.lastDateString = dateString
|
self.lastDateString = dateString
|
||||||
self.lastTime = datetime.datetime.now()
|
self.lastTime = datetime.datetime.now()
|
||||||
|
@ -70,6 +70,8 @@ settings = {
|
|||||||
'presentDate': True,
|
'presentDate': True,
|
||||||
'delaySec': 0,
|
'delaySec': 0,
|
||||||
'onMinutes': '00,30',
|
'onMinutes': '00,30',
|
||||||
|
'announce': True,
|
||||||
|
'interrupt': False,
|
||||||
},
|
},
|
||||||
'keyboard':{
|
'keyboard':{
|
||||||
'driver': 'evdev',
|
'driver': 'evdev',
|
||||||
|
Loading…
Reference in New Issue
Block a user