protected override bool testParameterInternal(GenericParameter parameter, object value)
 {
     try
     {
         if (parameter.Name.EqualsIgnoreCase(DEVICE_TYPE_PARAMETER))
         {
             if (value is EDeviceType dt)
             {
                 return(true);
             }
             else if (value is string str)
             {
                 return(true);
             }
             else if (value is int i)
             {
                 return(true);
             }
         }
         if (parameter.Name.EqualsIgnoreCase(PANEL_ID_PARAMETER))
         {
             try
             {
                 var val = LumosTools.TryConvertToInt32(value);
                 return(val.HasValue);
             }
             catch { return(false); }
         }
     }
     catch (Exception e)
     {
         log.Error(e);
     }
     return(base.testParameterInternal(parameter, value));
 }
        protected override bool setParameterInternal(GenericParameter parameter, object value, out object valueToSend)
        {
            try
            {
                valueToSend = null;
                if (parameter.Name.EqualsIgnoreCase(DEVICE_TYPE_PARAMETER))
                {
                    if (value is EDeviceType dt)
                    {
                        this.DeviceType = dt;
                    }
                    else if (value is string str)
                    {
                        this.DeviceType = (EDeviceType)Enum.Parse(typeof(EDeviceType), str);
                    }
                    else if (value is int i)
                    {
                        this.DeviceType = (EDeviceType)i;
                    }
                }
                if (parameter.Name.EqualsIgnoreCase(PANEL_ID_PARAMETER))
                {
                    //int for backward compatibility as DesklampID previous was an Integer
                    if (value is int id)
                    {
                        valueToSend = this.PanelID = id;
                        return(true);
                    }
                    else
                    {
                        var val = LumosTools.TryConvertToInt32(value);
                        if (val.HasValue)
                        {
                            this.PanelID = val.Value;
                            return(true);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                log.Error(e);
            }

            return(base.setParameterInternal(parameter, value, out valueToSend));
        }