Nadeflore / watchface-web-editor

A web editor for huami bin watchfaces

Home Page:https://watchface-web-editor.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After conversion from 6 to 7 a couple of widgets are visible when they should not

dave-chk opened this issue · comments

As per subject, in relation to a widget (IMG_LEVEL) that should appear only if the battery is low, and another one (TEXT_IMG) that should appear only if an alarm is set (displaying the time of the alarm).

I suppose that I can mess around with the produced index.js, in which I located the widgets I'm interested in, but I really can't say which methods are available for me to hide on conditions.

I managed to fix things by adding
"invalid_image: images/ablackimage.png"
to point to a black image for the Alarm.
While adding multiple images in the img_array of the IMG_LEVEL widget for battery indicator (low battery as the first image and multiple black images for the higher image numbers) and then changing the image length to the total number of images in the array:
image_length: 5.

I suppose that the old miband 6 just worked differently and without having black images in the assets, might be impossible to do this steps directly in conversion

Thanks for reporting this issue,

Due to the difference in behavior between the mi band 6 and 7, it might be complicated to fix these issue. This seems to be a very specific issue which only occurs with certain watch faces.
So I suggest to do as you did, to do some adjustments to the generated file.

But if you have suggestions for a better conversion, feel free to make a pull request with changes to the converter.

The code responsible for the conversion is here : https://github.com/Nadeflore/watchface-js/blob/main/src/watchFaceZeppOsTools/parametersToJs.js