New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery % wrong (bluetooth device) #551
Comments
Hi. Thanks for reporting. I will check this. Could you please try to restart the app, and check if the battery value will be more correct? |
Hello,
the value was previously 9%. Then I charged the keyboard to 100%. 9% displayed the app correctly.
Mit freundlichen Grüßen
Alexander Laue
mail: ***@***.***
web: https://www.qrz.com/db/DG0OJO
… Am 19.07.2021 um 16:55 schrieb Serhiy Mytrovtsiy ***@***.***>:
Hi. Thanks for reporting. I will check this.
It could be fixed at all. Because there are devices that are available only throw macOS cache (/Library/Preferences/com.apple.Bluetooth). So the level will be synchronized only when macOS will update them in this file.
Could you please try to restart the app, and check if the battery value will be more correct?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#551 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQYTBACTQI6JUXB25TB7CW3TYQ4ELANCNFSM5ATRPO4A>.
|
Emm, sorry but I think I do not understand. |
The app shows 1% instead of 100%
Mit freundlichen Grüßen
Alexander Laue
… Am 19.07.2021 um 18:53 schrieb Serhiy Mytrovtsiy ***@***.***>:
Emm, sorry but I think I do not understand.
So the app shows the correct battery level?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Could you help to understand why it's happening? |
v2.6.2 still can not show correct battery level of Magic Trackpad 2. I checked the file ( |
I found this. Maybe can help you. |
Hi. It's strange. Ok, I will recheck it. |
Could I ask you to check this build? |
Hi. Thanks for such a nice debug. According to the second message, the problem is not in the Stats. But in the process of how cache in macOS is updating. I notice the same bug with my AirPods. It updates the battery level on reconnect. I will try to fetch the battery level from |
And the |
feat: change UUID to address in the BLE device toolTip
Hi. I take a look at the |
Hi @exelban import Foundation
import IOKit
var serialPortIterator = io_iterator_t()
var object: io_object_t
let masterPort: mach_port_t = kIOMasterPortDefault
let matchingDict: CFDictionary = IOServiceMatching("AppleDeviceManagementHIDEventService")
let kernResult = IOServiceGetMatchingServices(masterPort, matchingDict, &serialPortIterator)
if KERN_SUCCESS == kernResult {
object = IOIteratorNext(serialPortIterator)
while object != 0 {
if let product: Unmanaged<AnyObject> = IORegistryEntryCreateCFProperty(object, "Product" as CFString, kCFAllocatorDefault, 0) {
let productValue: String = product.takeRetainedValue() as! String
print("Product: \(productValue)")
}
if let batteryPercent: Unmanaged<AnyObject> = IORegistryEntryCreateCFProperty(object, "BatteryPercent" as CFString, kCFAllocatorDefault, 0) {
let batteryPercentValue: Int = batteryPercent.takeRetainedValue() as! Int
print("Battery Level: \(batteryPercentValue)")
}
object = IOIteratorNext(serialPortIterator)
}
IOObjectRelease(object)
}
IOObjectRelease(serialPortIterator) I don't have a bluetooth earphone, so I can't test it. P.S You can download the |
@jack24254029 Thanks. As I said previously, it will work only with some devices. This way works only because Magic Trackpad is adding to the system as an input device (and only Apple devices, because my BLE keyboard does not visible in the I propose you continue this discussion in #557. |
OK, thank you. |
feat: change UUID to address in the BLE device toolTip
Not sure if this is still here, but I'm not being able to see my Bluetooth mouse (Apple Magic Mouse) on the dashboard there You can see in the first image there's a blank space there, which is where the battery should be displaying |
Stats show 1% and Apple 100% :-)
The text was updated successfully, but these errors were encountered: