From eb97b9b1eec1f2c9dfd3ecf12356be34f805efc7 Mon Sep 17 00:00:00 2001 From: fuleyi Date: Fri, 8 Nov 2024 13:26:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=AD=A3bluez=E5=B1=9E?= =?UTF-8?q?=E6=80=A7Percentage=E7=9A=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更正bluez属性Percentage的类型 --- bluetooth1/device.go | 2 +- system/bluetooth1/bluetooth.go | 4 ++-- system/bluetooth1/device.go | 6 +++--- timedate1/manager_format.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bluetooth1/device.go b/bluetooth1/device.go index 126381626..232dc65fb 100644 --- a/bluetooth1/device.go +++ b/bluetooth1/device.go @@ -54,7 +54,7 @@ type DeviceInfo struct { RSSI int16 Address string - Battery bool + Battery byte } func unmarshalDeviceInfo(data string) (*DeviceInfo, error) { diff --git a/system/bluetooth1/bluetooth.go b/system/bluetooth1/bluetooth.go index e868fee76..4f1a6bacf 100644 --- a/system/bluetooth1/bluetooth.go +++ b/system/bluetooth1/bluetooth.go @@ -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() diff --git a/system/bluetooth1/device.go b/system/bluetooth1/device.go index c5462d2d4..4472dc754 100644 --- a/system/bluetooth1/device.go +++ b/system/bluetooth1/device.go @@ -72,7 +72,7 @@ type device struct { RSSI int16 Address string - Battery bool + Battery byte connected bool connectedTime time.Time @@ -117,7 +117,7 @@ type backupDevice struct { RSSI int16 Address string - Battery bool + Battery byte } type connectPhase uint32 @@ -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 } diff --git a/timedate1/manager_format.go b/timedate1/manager_format.go index c725e364b..fce749b93 100644 --- a/timedate1/manager_format.go +++ b/timedate1/manager_format.go @@ -15,8 +15,8 @@ import ( ) const ( - dbusFormatPath = "/org/deepin/dde/Format" - dbusFormatInterface = "org.deepin.dde.Format" + dbusFormatPath = "/org/deepin/dde/Format1" + dbusFormatInterface = "org.deepin.dde.Format1" configManagerId = "org.desktopspec.ConfigManager" dbusFormatServiceName = dbusFormatInterface )