diff --git a/scripts/alexa_temperature.py b/scripts/alexa_temperature.py index 6de30e97a7cd113a18636f944466215a00374a79..fe673715f5d6aa1a553f5d3a66e10b12d1997167 100644 --- a/scripts/alexa_temperature.py +++ b/scripts/alexa_temperature.py @@ -5,12 +5,14 @@ from xaal.monitor import Monitor import platform UUID = tools.get_uuid +# device address, no config file here. +# this is just for testing. ADDR = UUID('aa16f008-5db4-11ec-a53d-d6bd5fe18736') - -ALEXA = UUID('c968a442-1d59-11ec-90a5-d6bd5fe18701') -GARAGE = UUID('0cbcf21c-92b0-11e8-80cd-408d5c18c800') -OUTDOOR = UUID( '5fcc6ad1-804d-49cb-b66c-e877f2374900') -INDOOR = UUID('43c4a724-055f-11e9-8716-82ed25e6aa00') +# devices uses in this scene +TTS_ALEXA = UUID('c968a442-1d59-11ec-90a5-d6bd5fe18701') +GARAGE = UUID('0cbcf21c-92b0-11e8-80cd-408d5c18c800') +OUTDOOR = UUID( '5fcc6ad1-804d-49cb-b66c-e877f2374900') +INDOOR = UUID('43c4a724-055f-11e9-8716-82ed25e6aa00') TEMP = [GARAGE,OUTDOOR,INDOOR] @@ -43,23 +45,24 @@ def main(): def run(): txt = '' - + # Alexa prefer when we use full phrases. tmp = get_temp(mon,OUTDOOR) if tmp: txt += 'la température extérieure est de %s°, ' % tmp tmp = get_temp(mon,GARAGE) if tmp: - txt += 'la Température du garage est de %s°, ' % tmp + txt += 'la température du garage est de %s°, ' % tmp tmp = get_temp(mon,INDOOR) if tmp: txt += 'La température du salon est de %s°.' % tmp - engine.send_request(dev,[ALEXA],'say',{'msg':txt}) - + engine.send_request(dev,[TTS_ALEXA],'say',{'msg':txt}) dev.methods['run'] = run + # no abort here, cause Alexa don't support this. + #dev.methods['abort'] = lambda: None engine.run() if __name__ == '__main__':