mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
fix: add logic to prevent vacancy from triggering room off if room is in
a call
This commit is contained in:
@@ -746,6 +746,24 @@ namespace PepperDash.Essentials
|
|||||||
//Implement this
|
//Implement this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool AllowVacancyTimerToStart()
|
||||||
|
{
|
||||||
|
bool allowVideo = true;
|
||||||
|
bool allowAudio = true;
|
||||||
|
|
||||||
|
if (VideoCodec != null)
|
||||||
|
{
|
||||||
|
allowVideo = !VideoCodec.IsInCall;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AudioCodec != null)
|
||||||
|
{
|
||||||
|
allowAudio = !AudioCodec.IsInCall;
|
||||||
|
}
|
||||||
|
|
||||||
|
return allowVideo && allowAudio;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does what it says
|
/// Does what it says
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false)
|
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false && AllowVacancyTimerToStart())
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Notice: Vacancy Detected");
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Notice: Vacancy Detected");
|
||||||
// Trigger the timer when the room is vacant
|
// Trigger the timer when the room is vacant
|
||||||
@@ -361,7 +361,19 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="o"></param>
|
/// <param name="o"></param>
|
||||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
public abstract void RoomVacatedForTimeoutPeriod(object o)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allow the vacancy event from an occupancy sensor to turn the room off.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>If the timer should be allowed. Defaults to true</returns>
|
||||||
|
protected virtual bool AllowVacancyTimerToStart()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user