Nadeflore / watchface-web-editor

A web editor for huami bin watchfaces
https://watchface-web-editor.vercel.app
GNU General Public License v3.0
29 stars 2 forks source link

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

Open dave-chk opened 1 year ago

dave-chk commented 1 year ago

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.

dave-chk commented 1 year ago

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

Nadeflore commented 1 year ago

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

xxfreex commented 1 month ago

Can I use the file generated here for miband 8 and 9 as well? will it work?