mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 12:37:07 +00:00
Fixes for the static GetPropertyByName method in DeviceJsonApi...now returns a property object rather than a PropertyInfo object
This commit is contained in:
parent
fc91ba7c1e
commit
0a34f48e0a
1 changed files with 5 additions and 5 deletions
|
|
@ -83,13 +83,13 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
||||||
{
|
{
|
||||||
var obj = FindObjectOnPath(deviceObjectPath);
|
var dev = FindObjectOnPath(deviceObjectPath);
|
||||||
if(obj == null)
|
if(dev == null)
|
||||||
return "{ \"error\":\"No Device\"}";
|
return "{ \"error\":\"No Device\"}";
|
||||||
|
|
||||||
|
object prop = dev.GetType().GetCType().GetProperty(propertyName).GetValue(dev, null);
|
||||||
|
|
||||||
CType t = obj.GetType();
|
// var prop = t.GetProperty(propertyName);
|
||||||
|
|
||||||
var prop = t.GetProperty(propertyName);
|
|
||||||
if (prop != null)
|
if (prop != null)
|
||||||
{
|
{
|
||||||
return prop;
|
return prop;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue