Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if u'おはよう' in word:
- msg = 'おはようございます!今は' + datetimestr + 'です!'
- #device = "light"
- command= ["tv", "tvon"]
- elif u'いってきます' in word:
- msg = 'いってらっしゃい!今日はきっといい事ありますよ!'
- command= ["light", "loff"]
- elif u'ただいま' in word:
- msg = 'おかえりなさい!おつかれさまでした!'
- command = ["tv", "tvon"]
- elif u'おやすみ' in word:
- msg = 'おやすみなさい!良い夢を!'
- command= ["light", "loff"]
- elif u'テレビオン' in word:
- msg = 'テレビを付けます!'
- command = ["tv", "tvon"]
- elif u'加湿器オン' in word:
- msg = '加湿器を付けます!'
- command = ["humid", "hon"]
- elif u'さよなら' in word or u'バイバイ' in word:
- msg = 'また話しかけてね!'
- 以下の部分で、コマンドに応じて赤外線送信や、室温のチェック、写真、LINE送付などを定義しています。取り入れたい機能に応じて、プログラムの記述を変えてみて下さい。
- [julius_remote.pyの一部]
- args = ['irsend', '-#', '1', 'SEND_ONCE', command[0], command[1]]
- try:
- led_blink("red",1)
- print(msg)
- os.system(aquest_dir + msg + ' | aplay')
- os.system('python ' + bme_command)
- os.system('python ' + camera_command)
- cam_msg = '写真を撮ってラインに送りました!'
- os.system(aquest_dir + cam_msg + ' | aplay')
- subprocess.Popen(args)
- print(command)
- led_blink("green",3)
- except OSError:
- print('command not found.')
Add Comment
Please, Sign In to add comment