diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 02789de..02789de --- a/CMakeLists.txt +++ b/CMakeLists.txt diff --git a/Doxyfile b/Doxyfile old mode 100755 new mode 100644 index c1a3113..c1a3113 --- a/Doxyfile +++ b/Doxyfile diff --git a/Jenkinsfile b/Jenkinsfile old mode 100755 new mode 100644 index 797bac2..797bac2 --- a/Jenkinsfile +++ b/Jenkinsfile diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 336964f..336964f --- a/README.md +++ b/README.md diff --git a/hueplusplus/CMakeLists.txt b/hueplusplus/CMakeLists.txt old mode 100755 new mode 100644 index 99182ba..99182ba --- a/hueplusplus/CMakeLists.txt +++ b/hueplusplus/CMakeLists.txt diff --git a/hueplusplus/ExtendedColorHueStrategy.cpp b/hueplusplus/ExtendedColorHueStrategy.cpp old mode 100755 new mode 100644 index 6c90ad7..6c90ad7 --- a/hueplusplus/ExtendedColorHueStrategy.cpp +++ b/hueplusplus/ExtendedColorHueStrategy.cpp diff --git a/hueplusplus/ExtendedColorTemperatureStrategy.cpp b/hueplusplus/ExtendedColorTemperatureStrategy.cpp old mode 100755 new mode 100644 index 5cf0352..5cf0352 --- a/hueplusplus/ExtendedColorTemperatureStrategy.cpp +++ b/hueplusplus/ExtendedColorTemperatureStrategy.cpp diff --git a/hueplusplus/Hue.cpp b/hueplusplus/Hue.cpp old mode 100755 new mode 100644 index df9867b..3731dad --- a/hueplusplus/Hue.cpp +++ b/hueplusplus/Hue.cpp @@ -283,6 +283,143 @@ bool Hue::lightExists(int id) const return false; } +std::string Hue::getPictureOfLight(int id) const +{ + std::string ret = ""; + auto pos = lights.find(id); + if (pos != lights.end()) + { + ret = getPictureOfModel(pos->second.getModelId()); + } + return ret; +} + +std::string Hue::getPictureOfModel(std::string model_id) const +{ + std::string ret = ""; + if(model_id == "LCT001" || model_id == "LCT007" || model_id == "LCT010" || model_id == "LCT014" || + model_id == "LTW010" || model_id == "LTW001" || model_id == "LTW004" || model_id == "LTW015" || + model_id == "LWB004" || model_id == "LWB006") + { + ret.append("e27_waca"); + } + else if (model_id == "LWB010" || model_id == "LWB014") + { + ret.append("e27_white"); + } + else if (model_id == "LCT012" || model_id == "LTW012") + { + ret.append("e14"); + } + else if (model_id == "LCT002") + { + ret.append("br30"); + } + else if (model_id == "LCT011" || model_id == "LTW011") + { + ret.append("br30_slim"); + } + else if (model_id == "LCT003") + { + ret.append("gu10"); + } + else if (model_id == "LTW013") + { + ret.append("gu10_perfectfit"); + } + else if (model_id == "LST001" || model_id == "LST002") + { + ret.append("lightstrip"); + } + else if (model_id == "LLC006 " || model_id == "LLC010") + { + ret.append("iris"); + } + else if (model_id == "LLC005" || model_id == "LLC011" || model_id == "LLC012" || + model_id == "LLC007") + { + ret.append("bloom"); + } + else if (model_id == "LLC014") + { + ret.append("aura"); + } + else if (model_id == "LLC013") + { + ret.append("storylight"); + } + else if (model_id == "LLC020") + { + ret.append("go"); + } + else if (model_id == "HBL001" || model_id == "HBL002" || model_id == "HBL003") + { + ret.append("beyond_ceiling_pendant_table"); + } + else if (model_id == "HIL001 " || model_id == "HIL002") + { + ret.append("impulse"); + } + else if (model_id == "HEL001 " || model_id == "HEL002") + { + ret.append("entity"); + } + else if (model_id == "HML001" || model_id == "HML002" || model_id == "HML003" || + model_id == "HML004" || model_id == "HML005") + { + ret.append("phoenix_ceiling_pendant_table_wall"); + } + else if (model_id == "HML006") + { + ret.append("phoenix_down"); + } + else if (model_id == "LTP001" || model_id == "LTP002" || model_id == "LTP003" || + model_id == "LTP004" || model_id == "LTP005" || model_id == "LTD003") + { + ret.append("pendant"); + } + else if (model_id == "LDF002" || model_id == "LTF001" || model_id == "LTF002" || + model_id == "LTC001" || model_id == "LTC002" || model_id == "LTC003" || + model_id == "LTC004" || model_id == "LTD001" || model_id == "LTD002" || + model_id == "LDF001") + { + ret.append("ceiling"); + } + else if (model_id == "LDD002 " || model_id == "LFF001") + { + ret.append("floor"); + } + else if (model_id == "LDD001 " || model_id == "LTT001") + { + ret.append("table"); + } + else if (model_id == "LDT001 " || model_id == "MWM001") + { + ret.append("recessed"); + } + else if (model_id == "BSB001") + { + ret.append("bridge_v1"); + } + else if (model_id == "BSB002") + { + ret.append("bridge_v2"); + } + else if (model_id == "SWT001") + { + ret.append("tap"); + } + else if (model_id == "RWL021") + { + ret.append("hds"); + } + else if (model_id == "SML001") + { + ret.append("motion_sensor"); + } + return ret; +} + void Hue::refreshState() { if (username.empty()) diff --git a/hueplusplus/HueLight.cpp b/hueplusplus/HueLight.cpp old mode 100755 new mode 100644 index 4be6e2e..4be6e2e --- a/hueplusplus/HueLight.cpp +++ b/hueplusplus/HueLight.cpp diff --git a/hueplusplus/LinHttpHandler.cpp b/hueplusplus/LinHttpHandler.cpp old mode 100755 new mode 100644 index 8ad676a..8ad676a --- a/hueplusplus/LinHttpHandler.cpp +++ b/hueplusplus/LinHttpHandler.cpp diff --git a/hueplusplus/SimpleBrightnessStrategy.cpp b/hueplusplus/SimpleBrightnessStrategy.cpp old mode 100755 new mode 100644 index a838615..a838615 --- a/hueplusplus/SimpleBrightnessStrategy.cpp +++ b/hueplusplus/SimpleBrightnessStrategy.cpp diff --git a/hueplusplus/SimpleColorHueStrategy.cpp b/hueplusplus/SimpleColorHueStrategy.cpp old mode 100755 new mode 100644 index e1a0c34..e1a0c34 --- a/hueplusplus/SimpleColorHueStrategy.cpp +++ b/hueplusplus/SimpleColorHueStrategy.cpp diff --git a/hueplusplus/SimpleColorTemperatureStrategy.cpp b/hueplusplus/SimpleColorTemperatureStrategy.cpp old mode 100755 new mode 100644 index 4e3e24d..4e3e24d --- a/hueplusplus/SimpleColorTemperatureStrategy.cpp +++ b/hueplusplus/SimpleColorTemperatureStrategy.cpp diff --git a/hueplusplus/UPnP.cpp b/hueplusplus/UPnP.cpp old mode 100755 new mode 100644 index 3dc68c5..3dc68c5 --- a/hueplusplus/UPnP.cpp +++ b/hueplusplus/UPnP.cpp diff --git a/hueplusplus/WinHttpHandler.cpp b/hueplusplus/WinHttpHandler.cpp old mode 100755 new mode 100644 index dca1a9c..dca1a9c --- a/hueplusplus/WinHttpHandler.cpp +++ b/hueplusplus/WinHttpHandler.cpp diff --git a/hueplusplus/include/BaseHttpHandler.h b/hueplusplus/include/BaseHttpHandler.h old mode 100755 new mode 100644 index d1f5f01..d1f5f01 --- a/hueplusplus/include/BaseHttpHandler.h +++ b/hueplusplus/include/BaseHttpHandler.h diff --git a/hueplusplus/include/BrightnessStrategy.h b/hueplusplus/include/BrightnessStrategy.h old mode 100755 new mode 100644 index dcf97eb..dcf97eb --- a/hueplusplus/include/BrightnessStrategy.h +++ b/hueplusplus/include/BrightnessStrategy.h diff --git a/hueplusplus/include/ColorHueStrategy.h b/hueplusplus/include/ColorHueStrategy.h old mode 100755 new mode 100644 index 062ca4c..062ca4c --- a/hueplusplus/include/ColorHueStrategy.h +++ b/hueplusplus/include/ColorHueStrategy.h diff --git a/hueplusplus/include/ColorTemperatureStrategy.h b/hueplusplus/include/ColorTemperatureStrategy.h old mode 100755 new mode 100644 index 7d26a19..7d26a19 --- a/hueplusplus/include/ColorTemperatureStrategy.h +++ b/hueplusplus/include/ColorTemperatureStrategy.h diff --git a/hueplusplus/include/ExtendedColorHueStrategy.h b/hueplusplus/include/ExtendedColorHueStrategy.h old mode 100755 new mode 100644 index 15e850a..15e850a --- a/hueplusplus/include/ExtendedColorHueStrategy.h +++ b/hueplusplus/include/ExtendedColorHueStrategy.h diff --git a/hueplusplus/include/ExtendedColorTemperatureStrategy.h b/hueplusplus/include/ExtendedColorTemperatureStrategy.h old mode 100755 new mode 100644 index ec3afc2..ec3afc2 --- a/hueplusplus/include/ExtendedColorTemperatureStrategy.h +++ b/hueplusplus/include/ExtendedColorTemperatureStrategy.h diff --git a/hueplusplus/include/Hue.h b/hueplusplus/include/Hue.h old mode 100755 new mode 100644 index 93b69e2..bb2efac --- a/hueplusplus/include/Hue.h +++ b/hueplusplus/include/Hue.h @@ -160,6 +160,24 @@ public: //! \return Bool that is true when a light with the given id exists and false when not bool lightExists(int id) const; + //! \brief Const function that returns the picture name of a given light id + //! + //! \note This will not update the local state of the bridge. + //! \note This function will only return the filename without extension, because + //! Philips provides different file types. + //! \param id Id of a light to get the picture of + //! \return String that either contains the filename of the picture of the light or if it was not found an empty string + std::string getPictureOfLight(int id) const; + + //! \brief Const function that returns the picture name of a given model id + //! + //! \note This will not update the local state of the bridge. + //! \note This function will only return the filename without extension, because + //! Philips provides different file types. + //! \param model_id Model Id of a device to get the picture of + //! \return String that either contains the filename of the picture of the device or if it was not found an empty string + std::string getPictureOfModel(std::string model_id) const; + //! \brief Function that sets the HttpHandler and updates the HueCommandAPI. //! //! The HttpHandler and HueCommandAPI are used for bridge communication diff --git a/hueplusplus/include/HueConfig.h b/hueplusplus/include/HueConfig.h old mode 100755 new mode 100644 index 965bb70..965bb70 --- a/hueplusplus/include/HueConfig.h +++ b/hueplusplus/include/HueConfig.h diff --git a/hueplusplus/include/HueLight.h b/hueplusplus/include/HueLight.h old mode 100755 new mode 100644 index cca0026..cca0026 --- a/hueplusplus/include/HueLight.h +++ b/hueplusplus/include/HueLight.h diff --git a/hueplusplus/include/IHttpHandler.h b/hueplusplus/include/IHttpHandler.h old mode 100755 new mode 100644 index 78a3631..78a3631 --- a/hueplusplus/include/IHttpHandler.h +++ b/hueplusplus/include/IHttpHandler.h diff --git a/hueplusplus/include/LinHttpHandler.h b/hueplusplus/include/LinHttpHandler.h old mode 100755 new mode 100644 index 41a2329..41a2329 --- a/hueplusplus/include/LinHttpHandler.h +++ b/hueplusplus/include/LinHttpHandler.h diff --git a/hueplusplus/include/SimpleBrightnessStrategy.h b/hueplusplus/include/SimpleBrightnessStrategy.h old mode 100755 new mode 100644 index 10b1bd7..10b1bd7 --- a/hueplusplus/include/SimpleBrightnessStrategy.h +++ b/hueplusplus/include/SimpleBrightnessStrategy.h diff --git a/hueplusplus/include/SimpleColorHueStrategy.h b/hueplusplus/include/SimpleColorHueStrategy.h old mode 100755 new mode 100644 index 5766c81..5766c81 --- a/hueplusplus/include/SimpleColorHueStrategy.h +++ b/hueplusplus/include/SimpleColorHueStrategy.h diff --git a/hueplusplus/include/SimpleColorTemperatureStrategy.h b/hueplusplus/include/SimpleColorTemperatureStrategy.h old mode 100755 new mode 100644 index cf37765..cf37765 --- a/hueplusplus/include/SimpleColorTemperatureStrategy.h +++ b/hueplusplus/include/SimpleColorTemperatureStrategy.h diff --git a/hueplusplus/include/UPnP.h b/hueplusplus/include/UPnP.h old mode 100755 new mode 100644 index 47f8166..47f8166 --- a/hueplusplus/include/UPnP.h +++ b/hueplusplus/include/UPnP.h diff --git a/hueplusplus/include/WinHttpHandler.h b/hueplusplus/include/WinHttpHandler.h old mode 100755 new mode 100644 index 7f07845..7f07845 --- a/hueplusplus/include/WinHttpHandler.h +++ b/hueplusplus/include/WinHttpHandler.h diff --git a/hueplusplus/include/json/json-forwards.h b/hueplusplus/include/json/json-forwards.h old mode 100755 new mode 100644 index ba8bd51..ba8bd51 --- a/hueplusplus/include/json/json-forwards.h +++ b/hueplusplus/include/json/json-forwards.h diff --git a/hueplusplus/jsoncpp.cpp b/hueplusplus/jsoncpp.cpp old mode 100755 new mode 100644 index e345d61..e345d61 --- a/hueplusplus/jsoncpp.cpp +++ b/hueplusplus/jsoncpp.cpp diff --git a/hueplusplus/test/CMakeLists.txt b/hueplusplus/test/CMakeLists.txt old mode 100755 new mode 100644 index c5dc208..c5dc208 --- a/hueplusplus/test/CMakeLists.txt +++ b/hueplusplus/test/CMakeLists.txt diff --git a/hueplusplus/test/CMakeLists.txt.in b/hueplusplus/test/CMakeLists.txt.in old mode 100755 new mode 100644 index 257b755..257b755 --- a/hueplusplus/test/CMakeLists.txt.in +++ b/hueplusplus/test/CMakeLists.txt.in diff --git a/hueplusplus/test/CodeCoverage.cmake b/hueplusplus/test/CodeCoverage.cmake old mode 100755 new mode 100644 index 8687a27..8687a27 --- a/hueplusplus/test/CodeCoverage.cmake +++ b/hueplusplus/test/CodeCoverage.cmake diff --git a/hueplusplus/test/mocks/mock_HttpHandler.h b/hueplusplus/test/mocks/mock_HttpHandler.h old mode 100755 new mode 100644 index bed49d1..bed49d1 --- a/hueplusplus/test/mocks/mock_HttpHandler.h +++ b/hueplusplus/test/mocks/mock_HttpHandler.h diff --git a/hueplusplus/test/mocks/mock_HueLight.h b/hueplusplus/test/mocks/mock_HueLight.h old mode 100755 new mode 100644 index 220e64a..220e64a --- a/hueplusplus/test/mocks/mock_HueLight.h +++ b/hueplusplus/test/mocks/mock_HueLight.h diff --git a/hueplusplus/test/test_BaseHttpHandler.cpp b/hueplusplus/test/test_BaseHttpHandler.cpp old mode 100755 new mode 100644 index 68c0efa..68c0efa --- a/hueplusplus/test/test_BaseHttpHandler.cpp +++ b/hueplusplus/test/test_BaseHttpHandler.cpp diff --git a/hueplusplus/test/test_ExtendedColorHueStrategy.cpp b/hueplusplus/test/test_ExtendedColorHueStrategy.cpp old mode 100755 new mode 100644 index c672e6e..c672e6e --- a/hueplusplus/test/test_ExtendedColorHueStrategy.cpp +++ b/hueplusplus/test/test_ExtendedColorHueStrategy.cpp diff --git a/hueplusplus/test/test_ExtendedColorTemperatureStrategy.cpp b/hueplusplus/test/test_ExtendedColorTemperatureStrategy.cpp old mode 100755 new mode 100644 index e004941..e004941 --- a/hueplusplus/test/test_ExtendedColorTemperatureStrategy.cpp +++ b/hueplusplus/test/test_ExtendedColorTemperatureStrategy.cpp diff --git a/hueplusplus/test/test_Hue.cpp b/hueplusplus/test/test_Hue.cpp old mode 100755 new mode 100644 index f6463e9..f6463e9 --- a/hueplusplus/test/test_Hue.cpp +++ b/hueplusplus/test/test_Hue.cpp diff --git a/hueplusplus/test/test_HueLight.cpp b/hueplusplus/test/test_HueLight.cpp old mode 100755 new mode 100644 index ecb62f2..ecb62f2 --- a/hueplusplus/test/test_HueLight.cpp +++ b/hueplusplus/test/test_HueLight.cpp diff --git a/hueplusplus/test/test_Main.cpp b/hueplusplus/test/test_Main.cpp old mode 100755 new mode 100644 index f12b69e..f12b69e --- a/hueplusplus/test/test_Main.cpp +++ b/hueplusplus/test/test_Main.cpp diff --git a/hueplusplus/test/test_SimpleBrightnessStrategy.cpp b/hueplusplus/test/test_SimpleBrightnessStrategy.cpp old mode 100755 new mode 100644 index 634eaa3..634eaa3 --- a/hueplusplus/test/test_SimpleBrightnessStrategy.cpp +++ b/hueplusplus/test/test_SimpleBrightnessStrategy.cpp diff --git a/hueplusplus/test/test_SimpleColorHueStrategy.cpp b/hueplusplus/test/test_SimpleColorHueStrategy.cpp old mode 100755 new mode 100644 index c0621c5..c0621c5 --- a/hueplusplus/test/test_SimpleColorHueStrategy.cpp +++ b/hueplusplus/test/test_SimpleColorHueStrategy.cpp diff --git a/hueplusplus/test/test_SimpleColorTemperatureStrategy.cpp b/hueplusplus/test/test_SimpleColorTemperatureStrategy.cpp old mode 100755 new mode 100644 index ff48638..ff48638 --- a/hueplusplus/test/test_SimpleColorTemperatureStrategy.cpp +++ b/hueplusplus/test/test_SimpleColorTemperatureStrategy.cpp diff --git a/hueplusplus/test/test_UPnP.cpp b/hueplusplus/test/test_UPnP.cpp old mode 100755 new mode 100644 index d6316f8..d6316f8 --- a/hueplusplus/test/test_UPnP.cpp +++ b/hueplusplus/test/test_UPnP.cpp diff --git a/hueplusplus/test/testhelper.h b/hueplusplus/test/testhelper.h old mode 100755 new mode 100644 index 0d706ec..0d706ec --- a/hueplusplus/test/testhelper.h +++ b/hueplusplus/test/testhelper.h