mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Merge pull request #1100 from PepperDash/feature/IHasBatteryStats
Add Interfaces for Battery Status Tracking
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -8,6 +9,7 @@ namespace PepperDash_Essentials_Core.Devices
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface for any device that is able to control it'spower and has a configurable reboot time
|
/// Interface for any device that is able to control it'spower and has a configurable reboot time
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
|
||||||
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
|
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -24,6 +26,7 @@ namespace PepperDash_Essentials_Core.Devices
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface for any device that contains a collection of IHasPowerReboot Devices
|
/// Interface for any device that contains a collection of IHasPowerReboot Devices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
|
||||||
public interface IHasControlledPowerOutlets : IKeyName
|
public interface IHasControlledPowerOutlets : IKeyName
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that has a battery that can be monitored
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasBatteryStats : IKeyName
|
||||||
|
{
|
||||||
|
int BatteryPercentage { get; }
|
||||||
|
int BatteryCautionThresholdPercentage { get; }
|
||||||
|
int BatteryWarningThresholdPercentage { get; }
|
||||||
|
BoolFeedback BatteryIsWarningFeedback { get; }
|
||||||
|
BoolFeedback BatteryIsCautionFeedback { get; }
|
||||||
|
BoolFeedback BatteryIsOkFeedback { get; }
|
||||||
|
IntFeedback BatteryPercentageFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that has a battery that can be monitored and the ability to charge and discharge
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasBatteryCharging : IHasBatteryStats
|
||||||
|
{
|
||||||
|
BoolFeedback BatteryIsCharging { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that has multiple batteries that can be monitored
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasBatteries : IKeyName
|
||||||
|
{
|
||||||
|
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasBatteryStatsExtended : IHasBatteryStats
|
||||||
|
{
|
||||||
|
int InputVoltage { get; }
|
||||||
|
int OutputVoltage { get; }
|
||||||
|
int InptuCurrent { get; }
|
||||||
|
int OutputCurrent { get; }
|
||||||
|
|
||||||
|
IntFeedback InputVoltageFeedback { get; }
|
||||||
|
IntFeedback OutputVoltageFeedback { get; }
|
||||||
|
IntFeedback InputCurrentFeedback { get; }
|
||||||
|
IntFeedback OutputCurrentFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that is able to control its power, has a configurable reboot time, and has batteries that can be monitored
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerCycleWithBattery : IHasPowerCycle, IHasBatteryStats
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that is able to control it's power and has a configurable reboot time
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Delay between power off and power on for reboot
|
||||||
|
/// </summary>
|
||||||
|
int PowerCycleTimeMs { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reboot outlet
|
||||||
|
/// </summary>
|
||||||
|
void PowerCycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for any device that contains a collection of IHasPowerReboot Devices
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasControlledPowerOutlets : IKeyName
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Collection of IPduOutlets
|
||||||
|
/// </summary>
|
||||||
|
ReadOnlyDictionary<int, IHasPowerCycle> PduOutlets { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -200,6 +200,7 @@
|
|||||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||||
|
<Compile Include="Devices\PowerInterfaces.cs" />
|
||||||
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
|
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
|
||||||
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
|
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
|
||||||
<Compile Include="Web\EssentialsWebApiHelpers.cs" />
|
<Compile Include="Web\EssentialsWebApiHelpers.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user