0.5.0 • Published 5 months ago

watchface-js v0.5.0

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
5 months ago

watchface-js

A javascript library and tools for huami watchfaces

Supported watch models

  • Xiaomi Mi Band 7 (Only for converting from miband 6 and converting images)
  • Xiaomi Mi Band 6
  • Xiaomi Mi Band 5
  • Xiaomi Mi Band 4
  • Amazfit X (Untested)
  • Amazfit T-Rex Pro (Untested)
  • Amazfit T-Rex / Verge Lite (Untested)
  • Amazfit GTS 2 mini (Untested)
  • Amazfit GTS 2 (Untested)
  • Amazfit GTS (Untested)
  • Amazfit GTR 2 (Untested)
  • Amazfit GTR 42mm (Untested)
  • Amazfit GTR 47mm (Untested)
  • Amazfit Bip (Untested)
  • Amazfit Bip S (Untested)
  • Amazfit Bip U (Untested)

Using command line tools

Installation

npm i -g watchface-js

Extracting watchface

wfjs readBin -i mywatchface.bin -m miband5

Packing watchface

wfjs writeBin -i watchfacefolder -m miband5

Converting mi band 6 watchface to mi band 7

wfjs convertBand6To7 -i mywatchface.bin

Converting png to zepp os tga (for use with mi band 7 watchface)

wfjs convertPngToTga -i picture.png

For more details on how to use command line tools

wfjs -h

Using javascript library

Installation

npm i --save watchface-js

Reading watchface

import { getAvailableModels, parseWatchFaceBin } from "watchface-js/watchFaceBinParser";

function readWatchFaceFile(buffer) {
    const models = getAvailableModels()
    
    const { parameters: parsedParameters, images: parsedImages } =
        parseWatchFaceBin(
            buffer,
            models[0].fileType // First model is miband6
        );
    
    console.log(parsedParameters)
}

For more a more complete example, you can look at the source code of Watchface web editor

0.5.0

5 months ago

0.4.0

5 months ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago