using System; using System.Collections.Generic; using System.Threading.Tasks; using Newtonsoft.Json; using PepperDash.Core; namespace PepperDash.Essentials.Core { /// /// Describes the functionality for an EssentailsRoomCombiner device /// public interface IEssentialsRoomCombiner : IKeyed { /// /// Indicates that the room combination scenario has changed /// event EventHandler RoomCombinationScenarioChanged; /// /// The current room combination scenario /// [JsonProperty("currentScenario")] IRoomCombinationScenario CurrentScenario { get; } /// /// When true, indicates the current mode is auto mode /// [JsonIgnore] BoolFeedback IsInAutoModeFeedback {get;} /// /// Gets a value indicating whether the automatic mode is disabled. /// [JsonProperty("disableAutoMode")] bool DisableAutoMode { get; } /// /// Gets a value indicating whether the system is operating in automatic mode. /// [JsonProperty("isInAutoMode")] bool IsInAutoMode { get; } /// /// Gets the collection of rooms associated with the current object. /// [JsonProperty("rooms")] List Rooms { get; } /// /// Sets auto mode /// void SetAutoMode(); /// /// Sets manual mode /// void SetManualMode(); /// /// Toggles the current mode between auto and manual /// void ToggleMode(); /// /// The available room combinatino scenarios /// [JsonProperty("roomCombinationScenarios")] List RoomCombinationScenarios { get; } /// /// The partition /// [JsonProperty("partitions")] List Partitions { get; } /// /// Toggles the state of a manual partition sensor /// /// void TogglePartitionState(string partitionKey); /// /// Sets the room combination scenario (if in manual mode) /// /// void SetRoomCombinationScenario(string scenarioKey); } /// /// Represents a scenario for combining rooms, including activation, deactivation, and associated state. /// /// This interface defines the behavior for managing room combination scenarios, including /// activation and deactivation, tracking the active state, and managing related partition states and UI mappings. /// Implementations of this interface are expected to handle the logic for room combinations based on the provided /// partition states and UI mappings. /// /// Defines the contract for IRoomCombinationScenario /// public interface IRoomCombinationScenario : IKeyName { /// /// When true, indicates that this room combination scenario is active /// [JsonIgnore] BoolFeedback IsActiveFeedback { get; } /// /// Gets a value indicating whether the entity is active. /// [JsonProperty("isActive")] bool IsActive { get; } /// /// Gets a value indicating whether this scenario should be hidden in the UI. /// [JsonProperty("hideInUi")] bool HideInUi { get; } /// /// Activates this room combination scenario /// Task Activate(); /// /// Deactivates this room combination scenario /// Task Deactivate(); /// /// The state of the partitions that would activate this scenario /// [JsonProperty("partitionStates")] List PartitionStates { get; } /// /// The mapping of UIs by key to rooms by key /// [JsonProperty("uiMap")] Dictionary UiMap { get; set; } } }