Commit 6f8222e37b28b2ef8007cc9fea8137229ff7dcfb
Committed by
Moritz Wirger
1 parent
8c3ccddf
Add const getName function in HueLight
Showing
2 changed files
with
11 additions
and
0 deletions
hueplusplus/HueLight.cpp
| ... | ... | @@ -51,6 +51,11 @@ std::string HueLight::getName() |
| 51 | 51 | return state["name"].asString(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | +std::string HueLight::getName() const | |
| 55 | +{ | |
| 56 | + return state["name"].asString(); | |
| 57 | +} | |
| 58 | + | |
| 54 | 59 | bool HueLight::setName(const std::string& name) |
| 55 | 60 | { |
| 56 | 61 | Json::Value request(Json::objectValue); | ... | ... |
hueplusplus/include/HueLight.h
| ... | ... | @@ -123,6 +123,12 @@ public: |
| 123 | 123 | //! \return String containig the name of the light |
| 124 | 124 | std::string getName(); |
| 125 | 125 | |
| 126 | + //! \brief Const function that returns the name of the light. | |
| 127 | + //! | |
| 128 | + //! \note This will not refresh the light state | |
| 129 | + //! \return String containig the name of the light | |
| 130 | + std::string getName() const; | |
| 131 | + | |
| 126 | 132 | //! \brief Function that sets the name of the light |
| 127 | 133 | //! |
| 128 | 134 | //! \return Bool that is true on success | ... | ... |