Skip to content

Commit a6d4043

Browse files
committed
fix: remove manual mode check and adjust auto mode logic
1. Removed manual mode check in setColorTempValue to allow temperature adjustment regardless of mode 2. Modified auto mode behavior in getColorTemperatureValue to use manual value when not default 3. This change provides more flexible temperature control and better handles edge cases in auto mode fix: 移除手动模式检查并调整自动模式逻辑 1. 移除setColorTempValue中的手动模式检查,允许在任何模式下调整色温 2. 修改getColorTemperatureValue中的自动模式行为,在非默认值时使用手动值 3. 此变更提供了更灵活的色温控制,并更好地处理自动模式下的边缘情况 pms: BUG-308201 pms: BUG-308209
1 parent 4de23d8 commit a6d4043

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

display1/color_temp.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,6 @@ func getTemperatureWithLine(line []byte) (int, bool) {
338338

339339
// dbus 上导出的方法
340340
func (m *Manager) setColorTempValue(value int32) error {
341-
if m.ColorTemperatureMode != ColorTemperatureModeManual {
342-
return errors.New("current not manual mode, can not adjust color temperature by manual")
343-
}
344341
if !isValidColorTempValue(value) {
345342
return errors.New("value out of range")
346343
}
@@ -393,7 +390,12 @@ func (m *Manager) getColorTemperatureValue() int {
393390
case ColorTemperatureModeManual:
394391
return int(manual)
395392
case ColorTemperatureModeAuto:
396-
return m.redshiftRunner.getValue()
393+
value := m.redshiftRunner.getValue()
394+
// 日落时,返回手动设置的色温(from v20)
395+
if value != defaultTemperature {
396+
value = int(manual)
397+
}
398+
return value
397399
case ColorTemperatureModeCustom:
398400
value := defaultTemperature
399401
if m.customColorTempFlag {

0 commit comments

Comments
 (0)