mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-29 04:15:00 +00:00
refactor: make messenger constructors more consistent
Some constructors for messengers were taking Device rather than the specific type they needed.
This commit is contained in:
@@ -8,9 +8,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
private readonly IChannel channelDevice;
|
||||
|
||||
public IChannelMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public IChannelMessenger(string key, string messagePath, IChannel device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
channelDevice = device as IChannel;
|
||||
channelDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class IColorMessenger : MessengerBase
|
||||
{
|
||||
private readonly IColor colorDevice;
|
||||
public IColorMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public IColorMessenger(string key, string messagePath, IColor device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
colorDevice = device as IColor;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class IDPadMessenger : MessengerBase
|
||||
{
|
||||
private readonly IDPad dpadDevice;
|
||||
public IDPadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public IDPadMessenger(string key, string messagePath, IDPad device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
dpadDevice = device as IDPad;
|
||||
dpadDevice = device;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class IDvrMessenger : MessengerBase
|
||||
{
|
||||
private readonly IDvr dvrDevice;
|
||||
public IDvrMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public IDvrMessenger(string key, string messagePath, IDvr device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
dvrDevice = device as IDvr;
|
||||
dvrDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class IHasPowerMessenger : MessengerBase
|
||||
{
|
||||
private readonly IHasPowerControl powerDevice;
|
||||
public IHasPowerMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public IHasPowerMessenger(string key, string messagePath, IHasPowerControl device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
powerDevice = device as IHasPowerControl;
|
||||
powerDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class INumericKeypadMessenger : MessengerBase
|
||||
{
|
||||
private readonly INumericKeypad keypadDevice;
|
||||
public INumericKeypadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public INumericKeypadMessenger(string key, string messagePath, INumericKeypad device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
keypadDevice = device as INumericKeypad;
|
||||
keypadDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class ISetTopBoxControlsMessenger : MessengerBase
|
||||
{
|
||||
private readonly ISetTopBoxControls stbDevice;
|
||||
public ISetTopBoxControlsMessenger(string key, string messagePath, IKeyName device) : base(key, messagePath, device)
|
||||
public ISetTopBoxControlsMessenger(string key, string messagePath, ISetTopBoxControls device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
stbDevice = device as ISetTopBoxControls;
|
||||
stbDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public class ITransportMessenger : MessengerBase
|
||||
{
|
||||
private readonly ITransport transportDevice;
|
||||
public ITransportMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||
public ITransportMessenger(string key, string messagePath, ITransport device) : base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
transportDevice = device as ITransport;
|
||||
transportDevice = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
|
||||
Reference in New Issue
Block a user