| 6 | |
| 7 | == Main line == |
| 8 | |
| 9 | '''pKNyX''' is not a ready-to-use application: it is a '''framework'''. This means that it is up-to-you to write the application which fits your needs. |
| 10 | |
| 11 | For that, you will need to know '''Python''', a powerfull , high level, object oriented, scripting language. Don't be afraid: Python is really easy to learn. It is now very popular, and used in many free and commercial applications to extend capabilities of compiled applications. It is now even teached at school, to young people (~15 years old)! There are hundreds documentations, tutorials and example on the web, and a huge community. Learning Python is really not a waste of time, and will help you to do other task than building your KNX application! |
| 12 | |
| 13 | '''pKNyX''' will provide you powerfull tools so you will only focus on '''your''' problem, and not on language subtilities, like it can be the case with other languages, like C, C++... |
| 14 | |
| 15 | Ok, let me show you what I have in mind. |
| 16 | |
| 17 | == Virtual Device == |
| 18 | |
| 19 | This is a central feature of '''pKNyX''', allowing user to create virtual devices which mimics real KNX devices. They follow the same architecture, like having '''Datapoints''' (aka as Communication Objects), which have to be linked to '''Group Address''' to communicate. |
| 20 | |
| 21 | Here is a very simple example: |
| 22 | |
| 23 | {{{ |
| 24 | #!python |
| 25 | from pknyx.api import Device, ETS |
| 26 | |
| 27 | class Vent(Device): |
| 28 | DP_01 = ("temp_1", "9.001", "cwtu", "low", 0) |
| 29 | DP_02 = {'name': "temp_2", dptId: "9.001", 'flags': "cwtu", 'priority': "low", 'initValue': 0} |
| 30 | DP_03 = dict(name="temp_3", dptId="9.001", flags="cwtu", priority="low", initValue=0) |
| 31 | |
| 32 | myVent = Vent("1.2.3") |
| 33 | ETS.link(myVent, "temp_1", "1/1/1") |
| 34 | ETS.link(myVent, "temp_2", "1/1/2") |
| 35 | ETS.link(myVent, "temp_3", "1/1/3") |
| 36 | }}} |
| 37 | |
| 38 | That's it! |