lihaoyun6 / AirBattery

Get the battery usage of all your devices on your Mac and put them on the Dock / Menu Bar / Widget! && 在Mac上获取你所有设备的电量信息并显示在Dock / 状态栏 / 小组件上!
https://lihaoyun6.github.io/airbattery/
GNU Affero General Public License v3.0
1.13k stars 32 forks source link

Widget icon display issue #60

Closed Ben-Jian closed 2 months ago

Ben-Jian commented 2 months ago

I am using a MacBook Air M1, which does not have a notch. However, the widget incorrectly displays the MacBook with a notch. Similarly, the widget incorrectly shows my iPhone as having a dynamic island instead of a notch.

lihaoyun6 commented 2 months ago

This has been fixed in v1.4.6, please check for updates😊

Ben-Jian commented 2 months ago

The issue with macbook is resolved! But there is still a problem with the iPhone icon due to a logic error: in AirBattery/Supports.swift at line 480: if (Int(id) ?? 0 > 14) { return "iphone-gen2" } should be: if (Int(id) ?? 0 < 14) { return "iphone-gen2" }

Additionally, at line 485: if let model = d.deviceModel, let m = model.components(separatedBy: ",").first, let id = m.components(separatedBy: "e").last { should be if let model = d.deviceModel, let m = model.components(separatedBy: ",").first, let id = m.components(separatedBy: "d").last {

lihaoyun6 commented 2 months ago

Ok, it's fixed in v1.4.7, I also added support for Apple Pencil in this version

Ben-Jian commented 2 months ago

Thank you for your hard work! 🎉🎉🎉