Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bluetooth1/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type DeviceInfo struct {
RSSI int16
Address string

Battery bool
Battery byte
}

func unmarshalDeviceInfo(data string) (*DeviceInfo, error) {
Expand Down
4 changes: 2 additions & 2 deletions system/bluetooth1/bluetooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,13 @@ func (b *SysBluetooth) updateBatteryForAdd(devPath dbus.ObjectPath) {
func (b *SysBluetooth) updateBatteryForRemove(devPath dbus.ObjectPath) {
if b.isDeviceExists(devPath) {
d, _ := b.getDevice(devPath)
d.Battery = false
d.Battery = 0

// update backup battery
b.backupDevicesMu.Lock()
idx := b.indexBackupDeviceNoLock(d.AdapterPath, devPath)
if idx != -1 {
b.backupDevices[d.AdapterPath][idx].Battery = false
b.backupDevices[d.AdapterPath][idx].Battery = 0
}
b.backupDevicesMu.Unlock()

Expand Down
6 changes: 3 additions & 3 deletions system/bluetooth1/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type device struct {
RSSI int16
Address string

Battery bool
Battery byte

connected bool
connectedTime time.Time
Expand Down Expand Up @@ -117,7 +117,7 @@ type backupDevice struct {
RSSI int16
Address string

Battery bool
Battery byte
}

type connectPhase uint32
Expand Down Expand Up @@ -497,7 +497,7 @@ func (d *device) connectProperties() {
d.blocked = value
})

_ = d.core.Battery().Percentage().ConnectChanged(func(hasValue bool, value bool) {
_ = d.core.Battery().Percentage().ConnectChanged(func(hasValue bool, value byte) {
if !hasValue {
return
}
Expand Down
Loading