Bug fix for LutronQuantumArea class that caused crash when debug level was set to 2 and data was received from device. Updates EssentialsEnvironmentDriver to only include environment devices in UI container columns if a matching UI driver can be constructed (ignores DIN8SW8)

This commit is contained in:
Neil Dorin
2018-06-26 10:41:43 -06:00
parent 2b6a13271f
commit 97db1f35a1
6 changed files with 30 additions and 25 deletions

View File

@@ -17,9 +17,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
CTimer SubscribeAfterLogin; CTimer SubscribeAfterLogin;
public int IntegrationId; string IntegrationId;
public string Username; string Username;
public string Password; string Password;
const string Delimiter = "\x0d\x0a"; const string Delimiter = "\x0d\x0a";
const string Set = "#"; const string Set = "#";
@@ -32,8 +32,8 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
IntegrationId = props.IntegrationId; IntegrationId = props.IntegrationId;
Username = props.Username; Username = props.Control.TcpSshProperties.Username;
Password = props.Password; Password = props.Control.TcpSshProperties.Password;
LightingScenes = props.Scenes; LightingScenes = props.Scenes;
@@ -89,7 +89,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// <param name="args"></param> /// <param name="args"></param>
void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args)
{ {
Debug.Console(2, this, "Text Received: '{0}'"); Debug.Console(2, this, "Text Received: '{0}'", args.Text);
if (args.Text.Contains("login:")) if (args.Text.Contains("login:"))
{ {
@@ -120,7 +120,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// <param name="args"></param> /// <param name="args"></param>
void PortGather_LineReceived(object sender, GenericCommMethodReceiveTextArgs args) void PortGather_LineReceived(object sender, GenericCommMethodReceiveTextArgs args)
{ {
Debug.Console(2, this, "Line Received: '{0}'"); Debug.Console(2, this, "Line Received: '{0}'", args.Text);
try try
{ {
@@ -128,7 +128,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
{ {
var response = args.Text.Split(','); var response = args.Text.Split(',');
var integrationId = Int32.Parse(response[1]); var integrationId = response[1];
if (integrationId != IntegrationId) if (integrationId != IntegrationId)
{ {
@@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
public override void SelectScene(LightingScene scene) public override void SelectScene(LightingScene scene)
{ {
Debug.Console(1, this, "Selecting Scene: '{0}'", scene.Name); Debug.Console(1, this, "Selecting Scene: '{0}'", scene.Name);
SendLine(string.Format("{0}AREA,{1},{2},{3}", Set, IntegrationId, eAction.Scene, scene.ID)); SendLine(string.Format("{0}AREA,{1},{2},{3}", Set, IntegrationId, (int)eAction.Scene, scene.ID));
} }
/// <summary> /// <summary>
@@ -188,7 +188,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterRaise() public void MasterRaise()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Raise)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Raise));
} }
/// <summary> /// <summary>
@@ -196,7 +196,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterLower() public void MasterLower()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Lower)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Lower));
} }
/// <summary> /// <summary>
@@ -204,7 +204,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterRaiseLowerStop() public void MasterRaiseLowerStop()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Stop)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Stop));
} }
/// <summary> /// <summary>
@@ -239,10 +239,11 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public ControlPropertiesConfig Control { get; set; } public ControlPropertiesConfig Control { get; set; }
public int IntegrationId { get; set; } public string IntegrationId { get; set; }
public List<LightingScene> Scenes{ get; set; } public List<LightingScene> Scenes { get; set; }
public string Username { get; set; } // Moved to use existing properties in Control object
public string Password { get; set; } //public string Username { get; set; }
//public string Password { get; set; }
} }
} }

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.3.0.*")] [assembly: AssemblyVersion("1.2.0.*")]

View File

@@ -121,22 +121,27 @@ namespace PepperDash.Essentials
if (device != null) if (device != null)
{ {
Devices.Add(device);
// Build the driver // Build the driver
var devicePanelDriver = GetPanelDriverForDevice(device, column); var devicePanelDriver = GetPanelDriverForDevice(device, column);
// Add new PanelDriverBase SubDriver // Add new PanelDriverBase SubDriver
if (devicePanelDriver != null) if (devicePanelDriver != null)
{
Devices.Add(device);
DeviceSubDrivers.Add(devicePanelDriver); DeviceSubDrivers.Add(devicePanelDriver);
Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key); Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key);
column++; column++;
// Quit if device count is exceeded
if (column > 4)
break;
}
else
Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key);
// Quit if device count is exceeded
if (column > 4)
break;
} }
} }

View File

@@ -214,7 +214,6 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList); TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList);
// Set Call Status Subpage Position // Set Call Status Subpage Position
#warning may need to add a new position when environment icon is displayed
if (nextJoin == 3951) if (nextJoin == 3951)
{ {