Tested working with GLS-ODT-C-CN hardware

This commit is contained in:
Neil Dorin
2021-02-04 11:01:21 -07:00
parent 2e4202ccce
commit ec43749ba4
2 changed files with 14 additions and 2 deletions

View File

@@ -95,9 +95,21 @@ namespace PepperDash.Essentials.Core
}); });
} }
public GlsOccupancySensorBaseController(string key, string name) public GlsOccupancySensorBaseController(string key, string name, DeviceConfig config)
: base(key, name) : base(key, name)
{ {
var props = config.Properties.ToObject<GlsOccupancySensorPropertiesConfig>();
if (props != null)
{
PropertiesConfig = props;
}
else
{
Debug.Console(1, this, "props are null. Unable to deserialize into GlsOccupancySensorPropertiesConfig");
}
AddPostActivationAction(() => AddPostActivationAction(() =>
{ {
OccSensor.OnlineStatusChange += (o, a) => OccSensor.OnlineStatusChange += (o, a) =>

View File

@@ -38,7 +38,7 @@ namespace PepperDash.Essentials.Core
public GlsOdtOccupancySensorController(string key, Func<DeviceConfig, GlsOdtCCn> preActivationFunc, public GlsOdtOccupancySensorController(string key, Func<DeviceConfig, GlsOdtCCn> preActivationFunc,
DeviceConfig config) DeviceConfig config)
: base(key, config.Name) : base(key, config.Name, config)
{ {
AddPreActivationAction(() => AddPreActivationAction(() =>
{ {