/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/powerdisplay/PowerDisplay.Lib/Models/MonitorStateEntry.cs
55 строк
2 KB
moooyo
PowerDisplay: Fall back to persisted VCP values when a monitor read fails (#49445)
03 авг 2026, 12:10
Не верифицирован
03 авг 2026, 12:10
ba2e89c
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace PowerDisplay.Common.Models { /// <summary> /// Individual monitor state entry for JSON persistence. /// Stores the current state of a monitor's adjustable parameters. /// </summary> public sealed class MonitorStateEntry { /// <summary> /// Gets or sets the brightness level (0-100), or <c>null</c> if not yet read from the monitor. /// </summary> [JsonPropertyName("brightness")] public int? Brightness { get; set; } /// <summary> /// Gets or sets the color temperature VCP value, or <c>null</c> if not yet read from the monitor. /// </summary> [JsonPropertyName("colorTemperature")] public int? ColorTemperatureVcp { get; set; } /// <summary> /// Gets or sets the contrast level (0-100), or <c>null</c> if not yet read from the monitor. /// </summary> [JsonPropertyName("contrast")] public int? Contrast { get; set; } /// <summary> /// Gets or sets the volume level (0-100), or <c>null</c> if not yet read from the monitor. /// </summary> [JsonPropertyName("volume")] public int? Volume { get; set; } /// <summary> /// Gets or sets the known-good VCP observations cached for this exact DevicePath monitor entry. /// Nullable because deserialization writes an explicit JSON <c>null</c> straight over the /// initializer; readers must treat it as optional. /// </summary> [JsonPropertyName("knownGoodVcpFeatures")] public List<KnownGoodVcpFeature>? KnownGoodVcpFeatures { get; set; } = new(); /// <summary> /// Gets or sets when this entry was last updated. /// </summary> [JsonPropertyName("lastUpdated")] public DateTime LastUpdated { get; set; } } }