diff --git a/ColorControl/ColorControl.csproj b/ColorControl/ColorControl.csproj
index b3bcf38..d344a57 100644
--- a/ColorControl/ColorControl.csproj
+++ b/ColorControl/ColorControl.csproj
@@ -27,7 +27,7 @@
ColorControl
Maassoft
0
- 4.4.0.0
+ 4.5.0.0
false
true
true
diff --git a/ColorControl/LgDevice.cs b/ColorControl/LgDevice.cs
index 29a81d6..2de652c 100644
--- a/ColorControl/LgDevice.cs
+++ b/ColorControl/LgDevice.cs
@@ -123,6 +123,12 @@ namespace ColorControl
AddGenericPictureAction("gameOptimizationHDMI2", typeof(OffToOn), category: "other");
AddGenericPictureAction("gameOptimizationHDMI3", typeof(OffToOn), category: "other");
AddGenericPictureAction("gameOptimizationHDMI4", typeof(OffToOn), category: "other");
+ //AddGenericPictureAction("freesyncOLEDHDMI4", typeof(OffToOn), category: "other");
+ //AddGenericPictureAction("freesyncSupport", typeof(OffToOn), category: "other");
+ AddGenericPictureAction("hdmiPcMode_hdmi1", typeof(FalseToTrue), category: "other");
+ 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);
AddInvokableAction("turnScreenOff", new Func, bool>(TurnScreenOffAction));
AddInvokableAction("turnScreenOn", new Func, bool>(TurnScreenOnAction));
@@ -321,6 +327,12 @@ namespace ColorControl
{
@params = new { mode = "user", flagUpdate = true };
}
+
+ if (preset.appId.Equals("com.webos.app.factorywin"))
+ {
+ @params = new { id = "executeFactory", irKey = "inStart" };
+ }
+
await _lgTvApi.LaunchApp(preset.appId, @params);
}
catch (Exception ex)
diff --git a/ColorControl/LgService.cs b/ColorControl/LgService.cs
index cb7e8c1..efcd824 100644
--- a/ColorControl/LgService.cs
+++ b/ColorControl/LgService.cs
@@ -64,6 +64,7 @@ namespace ColorControl
private int _poweredOffByScreenSaverProcessId;
private Task _monitorTask;
private int _monitorTaskCounter;
+ private LgPreset _lastTriggeredPreset;
public LgService(string dataPath, bool allowPowerOn) : base(dataPath, "LgPresets.json")
{
@@ -781,9 +782,11 @@ namespace ColorControl
toApplyPreset = toApplyPresets.First();
}
- if (_lastAppliedPreset != toApplyPreset)
+ if (_lastTriggeredPreset != toApplyPreset)
{
await ApplyPreset(toApplyPreset);
+
+ _lastTriggeredPreset = toApplyPreset;
}
}
}
diff --git a/ColorControl/MainForm.cs b/ColorControl/MainForm.cs
index 58539ed..64d0fd6 100644
--- a/ColorControl/MainForm.cs
+++ b/ColorControl/MainForm.cs
@@ -1329,7 +1329,7 @@ namespace ColorControl
chkLgRemoteControlShow.Checked = _lgService.Config.ShowRemoteControl;
scLgController.Panel2Collapsed = !_lgService.Config.ShowRemoteControl;
- Utils.BuildComboBox(cbxLgPresetTrigger, PresetTriggerType.Resume, PresetTriggerType.Screensaver, PresetTriggerType.Shutdown, PresetTriggerType.Standby, PresetTriggerType.Startup);
+ Utils.BuildComboBox(cbxLgPresetTrigger, PresetTriggerType.Resume, PresetTriggerType.Shutdown, PresetTriggerType.Standby, PresetTriggerType.Startup, PresetTriggerType.Reserved5, PresetTriggerType.ScreensaverStart, PresetTriggerType.ScreensaverStop);
}
private void InitOptionsTab()
@@ -1776,7 +1776,7 @@ namespace ColorControl
var dropDownValues = new List();
foreach (var enumValue in Enum.GetValues(action.EnumType))
{
- dropDownValues.Add(enumValue.ToString());
+ dropDownValues.Add(enumValue.ToString().Replace("_", ""));
}
var values = MessageForms.ShowDialog("Choose value", new[] {
diff --git a/ColorControl/MessageForms.cs b/ColorControl/MessageForms.cs
index 915d916..6665c87 100644
--- a/ColorControl/MessageForms.cs
+++ b/ColorControl/MessageForms.cs
@@ -97,8 +97,8 @@ namespace ColorControl
if (label.Contains("Ip-address"))
{
- textBox.Mask = "###.###.###.###";
- textBox.ValidatingType = typeof(System.Net.IPAddress);
+ //textBox.Mask = "990.990.990.990";
+ //textBox.ValidatingType = typeof(System.Net.IPAddress);
textBox.Culture = CultureInfo.InvariantCulture;
}
else if (label.Contains("MAC-address"))
diff --git a/ColorControl/PresetBase.cs b/ColorControl/PresetBase.cs
index 8ed825e..7d84a6c 100644
--- a/ColorControl/PresetBase.cs
+++ b/ColorControl/PresetBase.cs
@@ -19,10 +19,14 @@ namespace ColorControl
Shutdown = 3,
[Description("Standby")]
Standby = 4,
- [Description("Screensaver")]
- Screensaver = 5,
+ [Description("Reserved5")]
+ Reserved5 = 5,
[Description("Process switch")]
ProcessSwitch = 6,
+ [Description("Screensaver start")]
+ ScreensaverStart = 7,
+ [Description("Screensaver stop")]
+ ScreensaverStop = 8,
}
[Flags]
diff --git a/ColorControl/Properties/AssemblyInfo.cs b/ColorControl/Properties/AssemblyInfo.cs
index 8da5b59..1a0519e 100644
--- a/ColorControl/Properties/AssemblyInfo.cs
+++ b/ColorControl/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.4.0.0")]
-[assembly: AssemblyFileVersion("4.4.0.0")]
+[assembly: AssemblyVersion("4.5.0.0")]
+[assembly: AssemblyFileVersion("4.5.0.0")]
diff --git a/ColorControl/lgtv/LgTvApi.cs b/ColorControl/lgtv/LgTvApi.cs
index 1ce7ce6..73266cc 100644
--- a/ColorControl/lgtv/LgTvApi.cs
+++ b/ColorControl/lgtv/LgTvApi.cs
@@ -96,6 +96,12 @@ namespace LgTv
user
}
+ public enum FalseToTrue
+ {
+ false_,
+ true_
+ }
+
public class LgTvApi:IDisposable
{
public bool ConnectionClosed { get => _connection?.ConnectionClosed ?? true; }
@@ -501,7 +507,18 @@ namespace LgTv
}
else
{
- jsonValue = $"\"{value}\"";
+ if (key.Contains("_"))
+ {
+ var keys = key.Split('_');
+ key = keys[0];
+ var childKey = keys[1];
+
+ jsonValue = @"{ """ + childKey + @""": " + value + " }";
+ }
+ else
+ {
+ jsonValue = $"\"{value}\"";
+ }
}
var lunauri = "luna://com.webos.settingsservice/setSystemSettings";