Merge pull request #579 from PepperDash/hotfix/IrSetTopBoxBase-must-implement-ITvPresetsProvider

Implements ITvPresetsProvider on IrSetTopBoxBase
This commit is contained in:
Andrew Welker
2021-01-28 16:12:22 -07:00
committed by GitHub
4 changed files with 10 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
bool HasDpad { get; } bool HasDpad { get; }
PepperDash.Essentials.Core.Presets.DevicePresetsModel PresetsModel { get; } PepperDash.Essentials.Core.Presets.DevicePresetsModel TvPresets { get; }
void LoadPresets(string filePath); void LoadPresets(string filePath);
void DvrList(bool pressRelease); void DvrList(bool pressRelease);

View File

@@ -169,9 +169,9 @@ namespace PepperDash.Essentials.Core.PageManagers
} }
// Build presets // Build presets
if (stb.HasPresets && stb.PresetsModel != null) if (stb.HasPresets && stb.TvPresets != null)
{ {
PresetsView = new DevicePresetsView(trilist, stb.PresetsModel); PresetsView = new DevicePresetsView(trilist, stb.TvPresets);
} }
} }

View File

@@ -18,8 +18,8 @@ namespace PepperDash.Essentials.Core.PageManagers
{ {
SetTopBox = stb; SetTopBox = stb;
TriList = trilist; TriList = trilist;
if(stb.PresetsModel != null) if(stb.TvPresets != null)
PresetsView = new DevicePresetsView(trilist, stb.PresetsModel); PresetsView = new DevicePresetsView(trilist, stb.TvPresets);
} }
public override void Show() public override void Show()

View File

@@ -12,11 +12,12 @@ using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Presets; using PepperDash.Essentials.Core.Presets;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common namespace PepperDash.Essentials.Devices.Common
{ {
[Description("Wrapper class for an IR Set Top Box")] [Description("Wrapper class for an IR Set Top Box")]
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IHasPowerControl public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IHasPowerControl, ITvPresetsProvider
{ {
public IrOutputPortController IrPort { get; private set; } public IrOutputPortController IrPort { get; private set; }
@@ -28,7 +29,7 @@ namespace PepperDash.Essentials.Devices.Common
public bool HasDpad { get; set; } public bool HasDpad { get; set; }
public bool HasNumeric { get; set; } public bool HasNumeric { get; set; }
public DevicePresetsModel PresetsModel { get; private set; } public DevicePresetsModel TvPresets { get; private set; }
public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont, public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont,
SetTopBoxPropertiesConfig props) SetTopBoxPropertiesConfig props)
@@ -66,8 +67,8 @@ namespace PepperDash.Essentials.Devices.Common
public void LoadPresets(string filePath) public void LoadPresets(string filePath)
{ {
PresetsModel = new DevicePresetsModel(Key + "-presets", this, filePath); TvPresets = new DevicePresetsModel(Key + "-presets", this, filePath);
DeviceManager.AddDevice(PresetsModel); DeviceManager.AddDevice(TvPresets);
} }