Skip to content
Snippets Groups Projects
Commit 40527a8a authored by jkerdreu's avatar jkerdreu
Browse files

Some cleanup


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2780 b32b6428-25c9-4566-ad07-03861ab6144f
parent 312fbafe
Branches
No related tags found
No related merge requests found
......@@ -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__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment