Skip to content

Commit

Permalink
add property for api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-welker committed Dec 17, 2020
1 parent 71ac199 commit 16109be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions epi-display-lg/LgDisplayDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class LgDisplayController : TwoWayDisplayBase, IBasicVolumeWithFeedback,
private ActionIncrementer _volumeIncrementer;
private bool _volumeIsRamping;
private ushort _volumeLevelForSig;
private bool _smallDisplay;
//private GenericUdpServer _woLServer;

public LgDisplayController(string key, string name, LgDisplayPropertiesConfig config, IBasicCommunication comms)
Expand All @@ -49,6 +50,7 @@ public LgDisplayController(string key, string name, LgDisplayPropertiesConfig co
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Display configuration must be included");
return;
}
_smallDisplay = props.SmallDisplay;
Id = string.IsNullOrEmpty(props.Id) ? props.Id : "01";
_upperLimit = props.volumeUpperLimit;
_lowerLimit = props.volumeLowerLimit;
Expand Down Expand Up @@ -492,14 +494,15 @@ public override void ExecuteSwitch(object selector)
}
}


/// <summary>
/// Set Power On For Device
/// </summary>
public override void PowerOn()
{
if (_isSerialComm)
{
SendData(string.Format("ka {0} 1", Id));
SendData(string.Format("ka {0} {1}", Id, _smallDisplay ? "1": "01"));
}
}

Expand All @@ -508,7 +511,7 @@ public override void PowerOn()
/// </summary>
public override void PowerOff()
{
SendData(string.Format("ka {0} 0", Id));
SendData(string.Format("ka {0} {1}", Id, _smallDisplay ? "0" : "00"));
}

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions epi-display-lg/LgDisplayPropertiesConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ public class LgDisplayPropertiesConfig

[JsonProperty("macAddress")]
public string macAddress { get; set; }

[JsonProperty("smallDisplay")]
public bool SmallDisplay { get; set; }
}
}
4 changes: 2 additions & 2 deletions epi-display-lg/epi-display-lg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{9D249E47-8F95-4437-A6BB-563510287AD1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PDT.EssentialsPluginTemplate.EPI</RootNamespace>
<AssemblyName>PDT.EssentialsPluginTemplate.EPI</AssemblyName>
<RootNamespace>PepperDash.Plugins</RootNamespace>
<AssemblyName>epi-display-lg</AssemblyName>
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
Expand Down

0 comments on commit 16109be

Please sign in to comment.