add sorting of list views, improve refresh rate/color depth apply order, fix manually turned off tv's

This commit is contained in:
Vincent Maas committed 2022-05-01 10:07:22 +02:00
1 parent 66e682ba3d
commit c1ace0bdd5
13 files changed
+315 -48

No files matched your search

+11 -2
View File
@@ -21,6 +21,7 @@ namespace ColorControl
public string Category { get; set; }
public string Title { get; set; }
public int CurrentValue { get; set; }
public int NumberOfValues { get; set; }
public LgPreset Preset { get; set; }
}
@@ -170,7 +171,10 @@ namespace ColorControl
AddGenericPictureAction("hdmiPcMode_hdmi2", typeof(FalseToTrue), category: "other");
AddGenericPictureAction("hdmiPcMode_hdmi3", typeof(FalseToTrue), category: "other");
AddGenericPictureAction("hdmiPcMode_hdmi4", typeof(FalseToTrue), category: "other");
AddGenericPictureAction("adjustingLuminance", minValue: -50, maxValue: 50);
AddGenericPictureAction("adjustingLuminance", minValue: -50, maxValue: 50, numberOfValues: 22);
AddGenericPictureAction("whiteBalanceBlue", minValue: -50, maxValue: 50, numberOfValues: 22);
AddGenericPictureAction("whiteBalanceGreen", minValue: -50, maxValue: 50, numberOfValues: 22);
AddGenericPictureAction("whiteBalanceRed", minValue: -50, maxValue: 50, numberOfValues: 22);
//AddGenericPictureAction("wb20PointsGammaValue", minValue: -50, maxValue: 50);
AddInvokableAction("turnScreenOff", new Func<Dictionary<string, object>, bool>(TurnScreenOffAction));
AddInvokableAction("turnScreenOn", new Func<Dictionary<string, object>, bool>(TurnScreenOnAction));
@@ -212,7 +216,7 @@ namespace ColorControl
_invokableActions.Add(action);
}
private void AddGenericPictureAction(string name, Type type = null, decimal minValue = 0, decimal maxValue = 0, string category = "picture", string title = null)
private void AddGenericPictureAction(string name, Type type = null, decimal minValue = 0, decimal maxValue = 0, string category = "picture", string title = null, int numberOfValues = 1)
{
var action = new InvokableAction
{
@@ -221,6 +225,7 @@ namespace ColorControl
EnumType = type,
MinValue = minValue,
MaxValue = maxValue,
NumberOfValues = numberOfValues,
Category = category,
Title = title == null ? Utils.FirstCharUpperCase(name) : title
};
@@ -373,6 +378,10 @@ namespace ColorControl
PoweredOffBy = PowerOffSource.Unknown;
_poweredOffViaAppDateTime = DateTimeOffset.MinValue;
}
else if (payload.processing != null && ((string)payload.processing).Equals("Request Power Off", StringComparison.Ordinal))
{
PoweredOffBy = PoweredOffViaApp ? PowerOffSource.App : PowerOffSource.Manually;
}
}
else {
PoweredOffBy = PoweredOffViaApp ? PowerOffSource.App : PowerOffSource.Manually;