Skip to content

Commit

Permalink
use modelName for detection if eligible for motion pro
Browse files Browse the repository at this point in the history
  • Loading branch information
Maassoft committed May 30, 2021
1 parent 4614886 commit a17534a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ColorControl/ColorControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ProductName>ColorControl</ProductName>
<PublisherName>Maassoft</PublisherName>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.1.0.0</ApplicationVersion>
<ApplicationVersion>3.1.1.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
12 changes: 11 additions & 1 deletion ColorControl/LgDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class LgDevice
[JsonIgnore]
private Dictionary<string, Func<bool>> _invokableActions = new Dictionary<string, Func<bool>>();

[JsonIgnore]
public string ModelName { get; private set; }

[JsonConstructor]
public LgDevice(string name, string ipAddress, string macAddress, bool isCustom = true, bool isDummy = false)
{
Expand All @@ -60,7 +63,14 @@ public async Task<bool> Connect(int retries = 3)

//Test();
//_lgTvApi.Test3();
//_lgTvApi.SetSystemSettings();
if (_lgTvApi != null)
{
var info = await _lgTvApi.GetSystemInfo("modelName");
if (info != null)
{
ModelName = info.modelName;
}
}
return _lgTvApi != null;
}
catch (Exception ex)
Expand Down
3 changes: 2 additions & 1 deletion ColorControl/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,8 @@ private void chkLgRemoteControlShow_CheckedChanged(object sender, EventArgs e)

private void mnuLgExpert_Opening(object sender, CancelEventArgs e)
{
mnuLgOLEDMotionPro.Visible = _lgService.SelectedDevice?.Name.Contains("C9") ?? _lgService.SelectedDevice?.Name.Contains("B9") ?? false;
var device = _lgService.SelectedDevice;
mnuLgOLEDMotionPro.Visible = device?.ModelName != null ? (device.ModelName.Contains("C9") || device.ModelName.Contains("B9")) : false;

if (mnuLgExpertBacklight.DropDownItems.Count == 0)
{
Expand Down
4 changes: 2 additions & 2 deletions ColorControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.1.1.0")]
[assembly: AssemblyFileVersion("3.1.1.0")]
13 changes: 13 additions & 0 deletions ColorControl/lgtv/LgTvApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,19 @@ private async Task ExecuteRequest(string lunauri, object @params)
}
}

public async Task<dynamic> GetSystemInfo(params string[] keys)
{
var payload = new
{
keys = keys
};

var requestMessage = new RequestMessage("ssap://system/getSystemInfo", payload);
var command = _connection.SendCommandAsync(requestMessage);
var res = await command;
return res;
}

public void Close()
{
_connection.Close();
Expand Down

0 comments on commit a17534a

Please sign in to comment.