Skip to content

Commit

Permalink
fix: power save mode button status error
Browse files Browse the repository at this point in the history
power save mode button status must bind with power save mode

Log:
  • Loading branch information
dengbo11 committed Oct 13, 2023
1 parent 3785efd commit 761e133
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion system/power1/manager_ifc.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ func (m *Manager) SetCpuGovernor(governor string) *dbus.Error {

func (m *Manager) SetMode(mode string) *dbus.Error {
if m.Mode == mode {
return dbusutil.ToError(errors.New("Repeat switch"))
return dbusutil.ToError(errors.New("repeat switch"))
}

m.setPropPowerSavingModeAutoWhenBatteryLow(false)
m.setPropPowerSavingModeAuto(false)

err := m.doSetMode(mode)
if err == nil {
err = m.saveConfig()
Expand Down

0 comments on commit 761e133

Please sign in to comment.