Commit 6a8833427ec0fa6733e4f6b4640d6f4c621f4d2c
1 parent
3279b4e7
Add new function getColorType() to HueLight
Showing
2 changed files
with
9 additions
and
0 deletions
hueplusplus/HueLight.cpp
| @@ -47,6 +47,11 @@ std::string HueLight::getName() | @@ -47,6 +47,11 @@ std::string HueLight::getName() | ||
| 47 | return state["name"].asString(); | 47 | return state["name"].asString(); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | +ColorType HueLight::getCoorType() | ||
| 51 | +{ | ||
| 52 | + return colorType; | ||
| 53 | +} | ||
| 54 | + | ||
| 50 | unsigned int HueLight::KelvinToMired(unsigned int kelvin) | 55 | unsigned int HueLight::KelvinToMired(unsigned int kelvin) |
| 51 | { | 56 | { |
| 52 | return int(0.5f + (1000000 / kelvin)); | 57 | return int(0.5f + (1000000 / kelvin)); |
hueplusplus/include/HueLight.h
| @@ -110,6 +110,10 @@ public: | @@ -110,6 +110,10 @@ public: | ||
| 110 | //! \return String containig the name of the light | 110 | //! \return String containig the name of the light |
| 111 | std::string getName(); | 111 | std::string getName(); |
| 112 | 112 | ||
| 113 | + //! F\unction that returns the color type of the light. | ||
| 114 | + //! \return ColorType containig the color type of the light | ||
| 115 | + ColorType getCoorType(); | ||
| 116 | + | ||
| 113 | //! Function that converts Kelvin to Mired. | 117 | //! Function that converts Kelvin to Mired. |
| 114 | //! \param kelvin Unsigned integer value in Kelvin | 118 | //! \param kelvin Unsigned integer value in Kelvin |
| 115 | //! \return Unsigned integer value in Mired | 119 | //! \return Unsigned integer value in Mired |