Commit 234f60bbddc31594879ce51ca10197a0ef785d45
1 parent
6a883342
Adapt README to new refactored classes
Showing
1 changed file
with
17 additions
and
18 deletions
README.md
100644 → 100755
| ... | ... | @@ -36,33 +36,32 @@ Hue bridge = finder.GetBridge(bridges[0]); |
| 36 | 36 | ``` |
| 37 | 37 | |
| 38 | 38 | ### Controlling lights |
| 39 | -If you have your Bridge all set up now you can get and control its lights. | |
| 40 | -For that create a pointer of the specific light type you want to use. | |
| 41 | -You can choose from | |
| 42 | -* HueLight | |
| 43 | -* HueDimmableLight | |
| 44 | -* HueTemperatureLight | |
| 45 | -* HueColorLight | |
| 46 | -* HueExtendedColorLight | |
| 47 | - | |
| 48 | -Then call getLight(\<id\>) from you bridge object to get the specific light, where id | |
| 39 | +If you have your Bridge all set up now you can control its lights. | |
| 40 | +For that create a new HueLight and call getLight(\<id\>) from you bridge object to get a reference to a specific light, where id | |
| 49 | 41 | is the id of the light set internally by the Hue Bridge. |
| 50 | 42 | ```C++ |
| 51 | -std::unique_ptr<HueLight> pLamp1 = bridge.getLight(1); | |
| 52 | -HueExtendedColorLight& lamp1 = dynamic_cast<HueExtendedColorLight&>(*pLamp1); | |
| 43 | +HueLight light1 = bridge.getLight(1); | |
| 53 | 44 | ``` |
| 54 | 45 | If you now want to control the light you just call the specific function of the light. |
| 55 | 46 | ```C++ |
| 56 | -lamp1.On(); | |
| 57 | -lamp1.setBrightness(120); | |
| 58 | -lamp1.alertHueSaturation(25500, 255); | |
| 59 | -lamp1.setColorLoop(true); | |
| 60 | -lamp1.setColorRGB(255, 128, 0); | |
| 47 | +light1.On(); | |
| 48 | +light1.setBrightness(120); | |
| 49 | +light1.alertHueSaturation(25500, 255); | |
| 50 | +light1.setColorLoop(true); | |
| 51 | +light1.setColorRGB(255, 128, 0); | |
| 52 | +``` | |
| 53 | +But keep in mind that some light types do not have all functions available. So you might call a | |
| 54 | +specific function, but nothing will happen. For that you might want to check beforehand what type | |
| 55 | +of a lamp you are controlling. For that you can call the function getColorType(), which will return | |
| 56 | +a ColorType. | |
| 57 | +```C++ | |
| 58 | +ColorType type1 = light1.getColorType(); | |
| 61 | 59 | ``` |
| 62 | 60 | |
| 63 | 61 | ### Further reading |
| 64 | 62 | If you want to know more about all functions just look inside the doxygen description, |
| 65 | -which for now can be found in the regarding sourcecode file. | |
| 63 | +which for now can be found in the regarding sourcecode file or create the documentation | |
| 64 | +with the provided Doxyfile yourself. | |
| 66 | 65 | |
| 67 | 66 | ## Copyright |
| 68 | 67 | Copyright (c) 2017 Jan Rogall & Moritz Wirger. See LICENSE for further details. | ... | ... |