Compare commits

...

4 Commits

5 changed files with 102 additions and 8 deletions

View File

@@ -597,12 +597,21 @@ namespace PepperDash.Essentials
if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
{
Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
VideoCodec.StandbyDeactivate();
}
if (VideoCodec.StandbyIsOnFeedback.BoolValue)
{
VideoCodec.StandbyDeactivate();
}
else
{
Debug.Console(1, this, "Video codec not in standby. No need to wake.");
}
}
else
{
Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
}
// report back when done

View File

@@ -127,8 +127,20 @@ namespace PepperDash.Essentials.Core
AddPostActivationAction(() =>
{
ApplySettingsToSensorFromConfig();
});
OccSensor.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
{
ApplySettingsToSensorFromConfig();
}
};
if (OccSensor.IsOnline)
{
ApplySettingsToSensorFromConfig();
}
});
}
/// <summary>
@@ -148,6 +160,11 @@ namespace PepperDash.Essentials.Core
SetLedFlashEnable((bool)PropertiesConfig.EnableLedFlash);
}
if (PropertiesConfig.RemoteTimeout != null)
{
SetRemoteTimeout((ushort)PropertiesConfig.RemoteTimeout);
}
if (PropertiesConfig.ShortTimeoutState != null)
{
SetShortTimeoutState((bool)PropertiesConfig.ShortTimeoutState);

View File

@@ -62,8 +62,16 @@ namespace PepperDash.Essentials.Core
DeviceConfig config)
: base(key, config.Name)
{
var props = config.Properties.ToObject<GlsOccupancySensorPropertiesConfig>();
PropertiesConfig = config.Properties.ToObject<GlsOccupancySensorPropertiesConfig>();
if (props != null)
{
PropertiesConfig = props;
}
else
{
Debug.Console(1, this, "props are null. Unable to deserialize into GlsOccupancySensorPropertiesConfig");
}
AddPreActivationAction(() =>
{
@@ -77,12 +85,36 @@ namespace PepperDash.Essentials.Core
AddPostActivationAction(() =>
{
ApplySettingsToSensorFromConfig();
});
OccSensor.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
{
ApplySettingsToSensorFromConfig();
}
};
});
}
public GlsOccupancySensorBaseController(string key, string name) : base(key, name) { }
public GlsOccupancySensorBaseController(string key, string name)
: base(key, name)
{
AddPostActivationAction(() =>
{
OccSensor.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
{
ApplySettingsToSensorFromConfig();
}
};
if (OccSensor.IsOnline)
{
ApplySettingsToSensorFromConfig();
}
});
}
/// <summary>
@@ -90,16 +122,34 @@ namespace PepperDash.Essentials.Core
/// </summary>
protected virtual void ApplySettingsToSensorFromConfig()
{
Debug.Console(1, this, "Attempting to apply settings to sensor from config");
if (PropertiesConfig.EnablePir != null)
{
Debug.Console(1, this, "EnablePir found, attempting to set value from config");
SetPirEnable((bool)PropertiesConfig.EnablePir);
}
else
{
Debug.Console(1, this, "EnablePir null, no value specified in config");
}
if (PropertiesConfig.EnableLedFlash != null)
{
Debug.Console(1, this, "EnableLedFlash found, attempting to set value from config");
SetLedFlashEnable((bool)PropertiesConfig.EnableLedFlash);
}
if (PropertiesConfig.RemoteTimeout != null)
{
Debug.Console(1, this, "RemoteTimeout found, attempting to set value from config");
SetRemoteTimeout((ushort)PropertiesConfig.RemoteTimeout);
}
else
{
Debug.Console(1, this, "RemoteTimeout null, no value specified in config");
}
if (PropertiesConfig.ShortTimeoutState != null)
{
SetShortTimeoutState((bool)PropertiesConfig.ShortTimeoutState);
@@ -242,6 +292,8 @@ namespace PepperDash.Essentials.Core
/// <param name="state"></param>
public void SetPirEnable(bool state)
{
Debug.Console(1, this, "Setting EnablePir to: {0}", state);
if (state)
{
OccSensor.EnablePir.BoolValue = state;
@@ -327,6 +379,8 @@ namespace PepperDash.Essentials.Core
public void SetRemoteTimeout(ushort time)
{
Debug.Console(1, this, "Setting RemoteTimout to: {0}", time);
OccSensor.RemoteTimeout.UShortValue = time;
}

View File

@@ -65,6 +65,8 @@ namespace PepperDash.Essentials.Core
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
});
}
protected override void ApplySettingsToSensorFromConfig()
@@ -73,13 +75,25 @@ namespace PepperDash.Essentials.Core
if (PropertiesConfig.EnableUsA != null)
{
Debug.Console(1, this, "EnableUsA found, attempting to set value from config");
SetUsAEnable((bool)PropertiesConfig.EnableUsA);
}
else
{
Debug.Console(1, this, "EnableUsA null, no value specified in config");
}
if (PropertiesConfig.EnableUsB != null)
{
Debug.Console(1, this, "EnableUsB found, attempting to set value from config");
SetUsBEnable((bool)PropertiesConfig.EnableUsB);
}
else
{
Debug.Console(1, this, "EnablePir null, no value specified in config");
}
if (PropertiesConfig.OrWhenVacatedState != null)
{

View File

@@ -1369,7 +1369,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
set
{
// If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
BoolValue = value == "On";
BoolValue = value == "On" || value == "Standby";
OnValueChanged();
}
}