3
0

myCar.py 793 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/python3
  2. from flask import Flask
  3. from flask import url_for
  4. from flask import render_template
  5. app = Flask(__name__)
  6. @app.route('/')
  7. def myCar_root():
  8. return 'myCar project Page'
  9. @app.route('/bluetooth/controller')
  10. def myCar_bluetooth_controller():
  11. # this method will return available bluetooth devices as a list for the web template output
  12. import bluew
  13. #return len(bluew.controllers())
  14. return render_template('bluetooth/controller.html', bt_ctrl=bluew.controllers())
  15. @app.route('/bluetooth/devices')
  16. def myCar_bluetooth_devices():
  17. # this method will return available bluetooth devices as a list for the web template output
  18. import bluew
  19. #return len(bluew.controllers())
  20. return render_template('bluetooth/devices.html', bt_dev=bluew.devices())