---
  - name: "Say hello"
    neurons:
      - say:
          message: "Bonjour monsieur"
    when:
      - order: "dis bonjour"

  - name: "Run a simple script"
    neurons:
      - script:
        path: "/home/nico/test.sh"
      - say:
          message: "Script lancé, monsieur"
    when:
      - order: "lance le script"

  - name: "Say local date"
    neurons:
      - systemdate
    when:
      - order: "quelle heure"

  - name: "Close rolling shutter"
    neurons:
      - command: "curl http://192.168.0.22:5000/fermeture -d \"password=monpass\" -X POST"
      - say:
          message: "Fermeture en cours, monsieur"
    when:
      - order: "ferme les volets"

  - name: "Open rolling shutter"
    neurons:
      - command: "curl http://192.168.0.22:5000/ouverture -d \"password=monpass\" -X POST"
      - say:
          message: "Ouverture en cours, monsieur"
    when:
      - order: "ouvre les volets"

  - name: "Start steam"
    neurons:
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"kodi\",\"state\":\"stop\"}' http://192.168.0.17:5000/app"
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"steam\",\"state\":\"start\"}' http://192.168.0.17:5000/app"
      - say:
          message: "Lancement en cours, monsieur"
    when:
      - order: "lance steam"

  - name: "Start Kodi"
    neurons:
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"steam\",\"state\":\"stop\"}' http://192.168.0.17:5000/app"
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"kodi\",\"state\":\"start\"}' http://192.168.0.17:5000/app"
      - say:
          message: "Lancement en cours, monsieur"
    when:
      - order: "lance Cody"

  - name: "Start music"
    neurons:
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"music\",\"state\":\"start\"}' http://192.168.0.17:5000/app"
      - say:
          message: "Musique lancée, monsieur"
    when:
      - order: "mais nous de la musique"
      - order: "musique rock"

  - name: "Stop music"
    neurons:
      - command: "curl -i --user admin:secret -H \"Content-Type: application/json\" -X POST -d '{\"app_name\":\"music\",\"state\":\"stop\"}' http://192.168.0.17:5000/app"
      - say:
          message: "Musique stoppé, monsieur"
    when:
      - order: "arrête la musique"
      - order: "stop la musique"
      - order: "éteins la musique"

  - name: "Ansible test"
    neurons:
      - ansible_tasks: "tasks.yml"
      - say:
          message: "Tache terminée"
    when:
      - order: "playbook"