Compare commits

...

3 Commits

Author SHA1 Message Date
Neil Dorin
f0ae0094dc Adds optional enable property to partition sensor config and defaults to enable 2023-07-19 09:50:48 -06:00
Trevor Payne
fcd4b5d772 Merge pull request #1118 from PepperDash/hotfix/AirMediaRegistration
Fix Airmedia Registration Issue
2023-07-12 12:52:56 -05:00
Trevor Payne
c3ba6d5c28 fix: fix issue where the customactivate for the base class was beig suppressed in airmedia controllers 2023-07-12 12:27:38 -05:00
3 changed files with 30 additions and 13 deletions

View File

@@ -85,18 +85,32 @@ namespace PepperDash.Essentials.Core
{ {
if (_partitionSensor.IsOnline == false) return; if (_partitionSensor.IsOnline == false) return;
// Default to enable
_partitionSensor.Enable.BoolValue = true;
Debug.Console(1, this, "Attempting to apply settings to sensor from config"); Debug.Console(1, this, "Attempting to apply settings to sensor from config");
if (PropertiesConfig.Sensitivity != null) if (PropertiesConfig.Sensitivity != null)
{ {
Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config", Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config",
PropertiesConfig.Sensitivity); PropertiesConfig.Sensitivity);
_partitionSensor.Sensitivity.UShortValue = (ushort) PropertiesConfig.Sensitivity; _partitionSensor.Sensitivity.UShortValue = (ushort)PropertiesConfig.Sensitivity;
} }
else else
{ {
Debug.Console(1, this, "Sensitivity null, no value specified in config"); Debug.Console(1, this, "Sensitivity null, no value specified in config");
} }
if (PropertiesConfig.Enable != null)
{
Debug.Console(1, this, "Enable found, attempting to set value '{0}' from config",
PropertiesConfig.Enable);
_partitionSensor.Enable.BoolValue = (bool)PropertiesConfig.Enable;
}
else
{
Debug.Console(1, this, "Enable null, no value specified in config");
}
} }

View File

@@ -17,5 +17,8 @@ namespace PepperDash_Essentials_Core.PartitionSensor
/// </remarks> /// </remarks>
[JsonProperty("sensitivity")] [JsonProperty("sensitivity")]
public ushort? Sensitivity { get; set; } public ushort? Sensitivity { get; set; }
[JsonProperty("enable")]
public bool? Enable { get; set; }
} }
} }

View File

@@ -129,7 +129,7 @@ namespace PepperDash.Essentials.DM.AirMedia
else else
AirMedia.DisplayControl.DisableAutomaticRouting(); AirMedia.DisplayControl.DisableAutomaticRouting();
return true; return base.CustomActivate();
} }
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)