LightSwitch Plugin

  • 286 Views
  • Last Post 30 January 2016
stbluesrul posted this 30 January 2016

I am working with the LightSwitch plugin and I have it working, however, when I request the Devices List I'm getting the following error: "ERR~Method not found: 'Byte MLS.HA.DeviceController.Common.Device.HaDevice.getlevel()'".

Here is the method that is having the issue:

private void sendDeviceList(Socket LightSwitchClientSocket) {
List lS
devices = new List();

//Get Devices
foreach (var d in getDevices()) {
bool show = true;
//bool.TryParse(DevicePropertyValue.GetPropertyValue(d, "SHOWINLSLIST"), out show);

if (show) {
string devicestr = deviceToString(d);
if (!string.IsNullOrEmpty(device
str)) {
lSdevices.Add(devicestr);
}
}
}

if (sortlist) {
lSdevices.Sort();
}

// Send to Client
foreach (string d
str in lSdevices) {
//sendMessagetoClientsSocket(LightSwitchClientSocket, "DEVICE~" + d
str + Environment.NewLine);
sendMessagetoClientsSocket(LightSwitchClientSocket, d_str + Environment.NewLine);
}


}

Any help is appreciated. Thank you.

stbluesrul posted this 30 January 2016

Nevermind. Got it working by commenting out a few lines.

private void sendDeviceList(Socket LightSwitchClientSocket) {
List lSdevices = new List();

//Get Devices
foreach (var d in getDevices()) {
//bool show = true;
//bool.TryParse(DevicePropertyValue.GetPropertyValue(d, "SHOWINLSLIST"), out show);

///if (show) {
string device
str = deviceToString(d);
if (!string.IsNullOrEmpty(devicestr)) {
lS
devices.Add(devicestr);
/// }
}
}

if (
sortlist) {
lS
devices.Sort();
}

// Send to Client
foreach (string dstr in lSdevices) {
//sendMessagetoClientsSocket(LightSwitchClientSocket, "DEVICE~" + dstr + Environment.NewLine);
sendMessagetoClientsSocket(LightSwitchClientSocket, d
str + Environment.NewLine);
}


}

Close