[FEATURE]-IEssentialsRoom considerations
Is your feature request related to a problem? Please describe. To create a custom room it is required to implement IEssentialsRoom which contains far more than necessary for my use cases.
Describe the solution you'd like A simpler interface that represents the minimum required implementations for Essentials to load a room.
Additional context
public interface IEssentialsRoom : IKeyName, IKeyed, IReconfigurableDevice, IRunDefaultPresentRoute, IEnvironmentalControls
{
void StartShutdown(eShutdownType type);
void StartRoomVacancyTimer(eVacancyMode mode);
void Shutdown();
void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes);
void PowerOnToDefaultOrLastSource();
void SetDefaultLevels();
void RoomVacatedForTimeoutPeriod(object o);
BoolFeedback OnFeedback { get; }
BoolFeedback IsWarmingUpFeedback { get; }
BoolFeedback IsCoolingDownFeedback { get; }
IOccupancyStatusProvider RoomOccupancy { get; }
bool OccupancyStatusProviderIsRemote { get; }
bool IsMobileControlEnabled { get; }
IMobileControlRoomBridge MobileControlRoomBridge { get; }
string SourceListKey { get; }
SecondsCountdownTimer ShutdownPromptTimer { get; }
int ShutdownPromptSeconds { get; }
int ShutdownVacancySeconds { get; }
eShutdownType ShutdownType { get; }
EssentialsRoomEmergencyBase Emergency { get; }
MicrophonePrivacyController MicrophonePrivacy { get; }
string LogoUrlLightBkgnd { get; }
string LogoUrlDarkBkgnd { get; }
eVacancyMode VacancyMode { get; }
bool ZeroVolumeWhenSwtichingVolumeDevices { get; }
event EventHandler<EventArgs> RoomOccupancyIsSet;
}
Sorry for the delay in replying. I think it totally makes sense to pull out things that aren't core to base room operation and move them into their own interfaces that can be used to composite this existing interface together. Things like Occupancy, Mic Privacy, Emergency, etc can probably all be moved to their own interfaces. Make some proposals in what you'd like to see broken out and we can get the work done.
No worries in the delay; I had hopes of going through and proposing a solution along with this then got busy.
I would think it would make sense to have a similar construct to the plugin device...
psuedo:
public abstract class EssentialRoom : IKeyed
{
public EssentialsRoom(string key, string name) => this.Key = Key; this.Name = name;
}
public abstract class EssentialsBridgeableRoom : EssentialsRoom, IBridgeAdvanced
{
}
public abstract class EssentialsPluginRoomFactory<T> where T : EssentialsRoom
{
public abstract EssentialsRoom Build(Config config)
}
This way we can use interfaces to represent features and keep a consistent construct across Devices & Rooms.
I have not dove into what this might actually mean in code if we want to keep backwards compatibility with existing rooms within essentials.