Exemplo n.º 1
0
        /// <summary>
        /// Changes the valve state of the appliance. The call to this function is blocking until the API acknowledges the
        /// execution or failure of the command.
        /// </summary>
        /// <param name="appliance">The appliance to change the valve state of</param>
        /// <param name="open">The requested valve state</param>
        public void setValveOpen(SenseGuardAppliance appliance, bool open)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            ApplianceCommand applianceCommandOptional = getApplianceCommand(appliance);

            if (applianceCommandOptional == null)
            {
                return;
            }

            ApplianceCommand applianceCommand = applianceCommandOptional;

            ApplianceCommand.Command command = applianceCommand.getCommand();
            command.setValveOpen(open);
            applianceCommand.setCommand(command);

            action.putApplianceCommand(appliance, applianceCommand);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves the current status of the appliance. Note that the available properties of the returned ApplianceStatus
        /// object may differ from appliance type to appliance type.
        /// </summary>
        /// <param name="appliance">The BaseAppliance to retrieve command information from</param>
        /// <returns>The ApplianceStatus of the appliance</returns>
        public ApplianceStatus getApplianceStatus(BaseAppliance appliance)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            return(action.getApplianceStatus(appliance));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieves the current state of the appliances {@link ApplianceCommand} saved for the appliance in the
        /// GROHE account. This can be used to inspect the current state of the appliance and activated/queued commands.
        /// </summary>
        /// <param name="appliance">The SenseGuardAppliance to retrieve command information from</param>
        /// <returns>The ApplianceCommand of the appliance</returns>
        public ApplianceCommand getApplianceCommand(SenseGuardAppliance appliance)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            return(action.getApplianceCommand(appliance));
        }
Exemplo n.º 4
0
        /// <summary>
        /// The same as #getApplianceData(BaseAppliance), however, limits the requested data to a specific time range
        /// instead of requesting all data from all time.
        /// </summary>
        /// <param name="appliance">The BaseAppliance to retrieve data from</param>
        /// <param name="from">Needs to be an instance of DateTime which is at least one day before to</param>
        /// <param name="to">Needs to be an instance of DateTime which is at least one day after from</param>
        /// <returns>The SenseGuardApplianceData of the appliance in the given time range</returns>
        public BaseApplianceData getApplianceData(BaseAppliance appliance, DateTime?from = null, DateTime?to = null)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            return(action.getApplianceData(appliance, from, to));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Retrieves a single SenseGuardAppliance object from the Api without querying for all appliances inside the GROHE
        /// account.
        /// </summary>
        /// <param name="inRoom">The Room to look for the appliance in</param>
        /// <param name="applianceId">The room ID as retrieved by the GROHE Api</param>
        /// <returns>One specific SenseGuardAppliance</returns>
        public BaseAppliance getAppliance(Room inRoom, String applianceId)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            return(action.getAppliance(inRoom, applianceId));
        }
Exemplo n.º 6
0
        /// <summary>
        /// SenseGuardAppliances are real devices from GROHE, saved inside the GROHE account. They provide an interface
        /// to the appliance's features and data.
        /// </summary>
        /// <param name="inRoom">The Room to look for appliances in</param>
        /// <returns>The list of saved SenseGuardAppliances in the GROHE account</returns>
        public List <BaseAppliance> getAppliances(Room inRoom)
        {
            ApplianceAction action = apiClient.getAction <ApplianceAction>();

            return(action.getAppliances(inRoom));
        }