@@ -251,10 +251,11 @@ def updateSkillConfigurationFile(self, skillName: str, key: str, value: typing.A
251
251
# Cast value to template defined type
252
252
vartype = self ._skillsTemplateConfigurations [skillName ][key ]['dataType' ]
253
253
if vartype == 'boolean' :
254
- if value .lower () in {'on' , 'yes' , 'true' , 'active' }:
255
- value = True
256
- elif value .lower () in {'off' , 'no' , 'false' , 'inactive' }:
257
- value = False
254
+ if not isinstance (value , bool ):
255
+ if value .lower () in {'on' , 'yes' , 'true' , 'active' }:
256
+ value = True
257
+ elif value .lower () in {'off' , 'no' , 'false' , 'inactive' }:
258
+ value = False
258
259
elif vartype == 'integer' :
259
260
try :
260
261
value = int (value )
@@ -542,8 +543,11 @@ def getAliceConfigType(self, confName: str) -> typing.Optional[str]:
542
543
543
544
544
545
def isAliceConfHidden (self , confName : str ) -> bool :
545
- return confName in self ._aliceTemplateConfigurations and \
546
- self ._aliceTemplateConfigurations .get ('display' ) == 'hidden'
546
+ return self ._aliceTemplateConfigurations .get (confName , dict ()).get ('display' , '' ) == 'hidden'
547
+
548
+
549
+ def isAliceConfSensitive (self , confName : str ) -> bool :
550
+ return self ._aliceTemplateConfigurations .get (confName , dict ()).get ('isSensitive' , False )
547
551
548
552
549
553
def getAliceConfUpdatePreProcessing (self , confName : str ) -> typing .Optional [str ]:
@@ -653,14 +657,19 @@ def updateAdminPinCode(self):
653
657
654
658
655
659
def enableDisableSound (self ):
656
- if self .getAliceConfigByName ('disableSoundAndMic' ):
657
- self .WakewordManager .disableEngine ()
660
+ if self .getAliceConfigByName ('disableSound' ):
658
661
self .AudioServer .onStop ()
659
662
else :
660
- self .WakewordManager .enableEngine ()
661
663
self .AudioServer .onStart ()
662
664
663
665
666
+ def enableDisableCapture (self ):
667
+ if self .getAliceConfigByName ('disableCapture' ):
668
+ self .WakewordManager .disableEngine ()
669
+ else :
670
+ self .WakewordManager .enableEngine ()
671
+
672
+
664
673
def restartWakewordEngine (self ):
665
674
self .WakewordManager .restartEngine ()
666
675
@@ -706,7 +715,7 @@ def populateAudioInputConfig(self):
706
715
devices = self ._listAudioDevices ()
707
716
self .updateAliceConfigDefinitionValues (setting = 'inputDevice' , value = devices )
708
717
except :
709
- if not self .getAliceConfigByName ('disableSoundAndMic ' ):
718
+ if not self .getAliceConfigByName ('disableCapture ' ):
710
719
self .logWarning ('No audio input device found' )
711
720
712
721
@@ -715,7 +724,7 @@ def populateAudioOutputConfig(self):
715
724
devices = self ._listAudioDevices ()
716
725
self .updateAliceConfigDefinitionValues (setting = 'outputDevice' , value = devices )
717
726
except :
718
- if not self .getAliceConfigByName ('disableSoundAndMic ' ):
727
+ if not self .getAliceConfigByName ('disableSound ' ):
719
728
self .logWarning ('No audio output device found' )
720
729
721
730
0 commit comments