From 1388003d8a725c667d01bd56d6177072a5e86e80 Mon Sep 17 00:00:00 2001 From: Nodeduino Date: Wed, 29 Nov 2017 20:39:07 +0100 Subject: [PATCH] Add new function in HueLight - add function for getting the id of a light --- hueplusplus/HueLight.cpp | 5 +++++ hueplusplus/include/HueLight.h | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hueplusplus/HueLight.cpp b/hueplusplus/HueLight.cpp index 73ef334..accfd7a 100755 --- a/hueplusplus/HueLight.cpp +++ b/hueplusplus/HueLight.cpp @@ -61,6 +61,11 @@ std::string HueLight::getName() const return state["name"].asString(); } +int HueLight::getId() const +{ + return id; +} + bool HueLight::setName(const std::string& name) { Json::Value request(Json::objectValue); diff --git a/hueplusplus/include/HueLight.h b/hueplusplus/include/HueLight.h index cfa3b84..7f1499f 100755 --- a/hueplusplus/include/HueLight.h +++ b/hueplusplus/include/HueLight.h @@ -135,6 +135,11 @@ public: //! \return String containig the name of the light std::string getName() const; + //! \brief Const function that returns the id of this light + //! + //! \return integer representing the light id + int getId() const; + //! \brief Function that sets the name of the light //! //! \return Bool that is true on success -- libgit2 0.21.4