mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
getting asset created
This commit is contained in:
@@ -42,7 +42,29 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
{
|
{
|
||||||
FusionAsset tempAsset;
|
FusionAsset tempAsset;
|
||||||
|
|
||||||
|
display.UsageTracker = new UsageTracking(display){UsageIsTracked = true};
|
||||||
|
display.UsageTracker.DeviceUsageEnded += UsageTrackerOnDeviceUsageEnded;
|
||||||
|
|
||||||
|
var config = ConfigReader.ConfigObject.Devices.SingleOrDefault((d) => d.Key == display.Key);
|
||||||
|
|
||||||
|
if (!FusionStaticAssets.TryGetValue(config.Uid, out tempAsset))
|
||||||
|
{
|
||||||
|
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), display.Name,
|
||||||
|
"Display", "");
|
||||||
|
FusionStaticAssets.Add(config.Uid, tempAsset);
|
||||||
|
}
|
||||||
|
|
||||||
|
var displayAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display",
|
||||||
|
tempAsset.InstanceId);
|
||||||
|
|
||||||
|
displayAsset.PowerOn.OutputSig.UserObject = new Action<bool>(b => { if (b) display.PowerOn(); });
|
||||||
|
displayAsset.PowerOff.OutputSig.UserObject = new Action<bool>(b => { if (b) display.PowerOff(); });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UsageTrackerOnDeviceUsageEnded(object sender, DeviceUsageEventArgs deviceUsageEventArgs)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user