Beispiel #1
0
        /// <summary>
        /// 1.7 Delete lights
        /// URL: http://<bridgeipaddress>/api/<username>/lights/<id>
        /// Method: DELETE
        /// Version: 1.0
        /// Permission: Whitelist
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static async Task <bool> DeleteLight(string url)
        {
            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Url to be used: " + url);

            bool   success  = false;
            string response = await RESTHelper.Delete(url);

            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Response recieved: : " + response);
            success = ErrorHelper.CheckForError(response, success);
            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Sucess: " + success.ToString());

            return(success);
        }
        /// <summary>
        /// 1.7 Delete lights
        /// URL: http://<bridgeipaddress>/api/<username>/lights/<id>
        /// Method: DELETE
        /// Version: 1.0
        /// Permission: Whitelist
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static async Task <bool> DeleteLight(string ipAddress, string userName, string id)
        {
            string url = ipBase + ipAddress + apiBase + userName + apiGroup + "/" + id;

            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Url to be used: " + url);

            bool   success  = false;
            string response = await RESTHelper.Delete(url);

            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Response recieved: : " + response);
            success = ErrorHelper.CheckForError(response, success);
            Debug.WriteLine("<Philips Hue - APIs - Lights> DeleteLight - Sucess: " + success.ToString());

            return(success);
        }
        /// <summary>
        /// Remove value of specified Node
        /// </summary>
        /// <returns></returns>
        public GeneralCallback Remove()
        {
            GeneralCallback callbackHandler = new GeneralCallback();

            string route = FirebaseConfig.endpoint + path + ".json" + GetAuthParam();

            RESTHelper.Delete(route, res =>
            {
                callbackHandler.successCallback?.Invoke();
            },
                              err =>
            {
                callbackHandler.exceptionCallback?.Invoke(err);
            });

            return(callbackHandler);
        }