Coder Social home page Coder Social logo

pytimefliplib's Introduction

pytimefliplib

A Python library TimeFlip devices v3 and v4.

The communication protocol (empirically corrected) for the V3 version is described here (originally described here).

The one concerning V4 is given here.

Install and use

pip install git+https://github.com/pierre-24/pytimefliplib.git

Provides, with a simple Python API, convenient scripts to interact with the device:

  • Discover TimeFlip devices:

    $ timeflip-discover 
    Looking around (this can take up to 1 minute) ... Done!
    Results::
    - TimeFlip devices: 0C:61:CF:C7:77:71 (TimeFlip)
    - Other BLE devices: (redacted)
    - Other devices: (redacted)
    

    The MAC address of my device is thus 0C:61:CF:C7:77:71.

  • Change its password:

    $ timeflip-set-passwd -a 98:07:2D:EE:21:0E 123456
    ! Connected to 98:07:2D:EE:21:0E
    ! Password communicated
    ! Changed password to "123456"
    

    Don't forget to use -p for further interactions!

  • Change its name:

    $ timeflip-set-name -a 98:07:2D:EE:21:0E -p 123456 MyFlip
    ! Connected to 98:07:2D:EE:21:0E
    ! Password communicated
    ! Changed device name from "TimeFlip" to "MyFlip"
    
  • Get its status:

    $ timeflip-check -a 98:07:2D:EE:21:0E -p 123456
    ! Connected to 98:07:2D:EE:21:0E
    ! Password communicated
    TimeFlip characteristics::
    - Name: MyFlip
    - Firmware: TFv3.1
    - Battery: 83
    - Calibration: 0
    - Current facet: 9
    - Accelerometer vector: 0.832, -0.438, 0.262
    - Status: {'locked': False, 'paused': False, 'auto_pause_time': 0}
    History::
    - Facet=0, during 2 seconds
    - Facet=1, during 712 seconds
    (...)
    
    • Clear its history
    $ timeflip-clear-history -a 98:07:2D:EE:21:0E -p 123456
    ! Connected to 98:07:2D:EE:21:0E
    ! Password communicated
    ! Cleared history
    

As you can see, the options you have to give to every script (except timeflip-discover, of course) are:

  • -a, the MAC address of the device and, eventually,
  • -p, the password (if it differs from the default password, 000000).

pytimefliplib's People

Contributors

pierre-24 avatar john-craig avatar cthulhaire avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.