xaal.lib 0.7.2__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/PKG-INFO +25 -22
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/README.rst +19 -20
- xaal_lib-0.7.3/pyproject.toml +31 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/cbor.py +9 -4
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal.lib.egg-info/PKG-INFO +25 -22
- xaal_lib-0.7.2/pyproject.toml +0 -11
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/setup.cfg +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_bindings.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_cbor.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_device.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_engine.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_message.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/tests/test_tools.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/__init__.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/__init__.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/__main__.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/aioengine.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/aiohelpers.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/aionetwork.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/bindings.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/config.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/core.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/devices.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/engine.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/exceptions.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/helpers.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/messages.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/network.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/test.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal/lib/tools.py +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal.lib.egg-info/SOURCES.txt +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal.lib.egg-info/dependency_links.txt +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal.lib.egg-info/requires.txt +0 -0
- {xaal_lib-0.7.2 → xaal_lib-0.7.3}/xaal.lib.egg-info/top_level.txt +0 -0
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xaal.lib
|
|
3
|
-
Version: 0.7.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.7.3
|
|
4
|
+
Summary: Official Python stack for xAAL protocol
|
|
5
5
|
Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
|
|
6
6
|
License: GPL License
|
|
7
|
+
Project-URL: Homepage, https://recherche.imt-atlantique.fr/xaal/
|
|
8
|
+
Project-URL: Documentation, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/entry/code/Python/branches/0.7/libs/lib/README.rst
|
|
9
|
+
Project-URL: Source, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/show/code/Python/branches/0.7/libs/lib
|
|
7
10
|
Keywords: xaal,home-automation
|
|
8
11
|
Classifier: Programming Language :: Python
|
|
9
12
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Topic :: Home Automation
|
|
10
14
|
Description-Content-Type: text/x-rst
|
|
11
15
|
Requires-Dist: cbor2==5.4.2
|
|
12
16
|
Requires-Dist: pysodium
|
|
@@ -20,7 +24,7 @@ Requires-Dist: aioconsole
|
|
|
20
24
|
xaal.lib
|
|
21
25
|
========
|
|
22
26
|
**xaal.lib** is the official Python stack to develop home-automation devices and gateways
|
|
23
|
-
with the xAAL protocol. For a full description of the protocol check out
|
|
27
|
+
with the xAAL protocol. For a full description of the protocol check out
|
|
24
28
|
http://recherche.imt-atlantique.fr/xaal/
|
|
25
29
|
|
|
26
30
|
|
|
@@ -38,8 +42,8 @@ xaal.lib depends on :
|
|
|
38
42
|
|
|
39
43
|
Install
|
|
40
44
|
~~~~~~~
|
|
41
|
-
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
42
|
-
<https://redmine.
|
|
45
|
+
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
46
|
+
<https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7/README.html>`_
|
|
43
47
|
|
|
44
48
|
|
|
45
49
|
Usage
|
|
@@ -52,7 +56,7 @@ To receive / parse / display incoming xAAL messages, you can simply try somethin
|
|
|
52
56
|
this:
|
|
53
57
|
|
|
54
58
|
.. code-block:: python
|
|
55
|
-
|
|
59
|
+
|
|
56
60
|
from xaal.lib import Engine
|
|
57
61
|
|
|
58
62
|
def display(msg):
|
|
@@ -61,31 +65,31 @@ this:
|
|
|
61
65
|
eng = Engine()
|
|
62
66
|
eng.subscribe(display)
|
|
63
67
|
eng.run()
|
|
64
|
-
|
|
68
|
+
|
|
65
69
|
The Engine will call the display function every time it receive a xAAL message.
|
|
66
70
|
|
|
67
|
-
Let's take a look at a simple lamp device :
|
|
71
|
+
Let's take a look at a simple lamp device :
|
|
68
72
|
|
|
69
73
|
.. code-block:: python
|
|
70
|
-
|
|
74
|
+
|
|
71
75
|
from xaal.lib import Device,Engine,tools
|
|
72
|
-
|
|
76
|
+
|
|
73
77
|
# create and configure the lamp device, with a random address
|
|
74
|
-
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
78
|
+
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
75
79
|
dev.product_id = 'Dummy Lamp'
|
|
76
80
|
dev.url = 'http://www.acme.org'
|
|
77
81
|
dev.info = 'My fake lamp'
|
|
78
82
|
|
|
79
83
|
# add an xAAL attribute 'light'
|
|
80
84
|
light = dev.new_attribute('light')
|
|
81
|
-
|
|
85
|
+
|
|
82
86
|
# declare two device methods ON & OFF
|
|
83
87
|
def on():
|
|
84
88
|
light.value = True
|
|
85
89
|
|
|
86
90
|
def off():
|
|
87
91
|
light.value = False
|
|
88
|
-
|
|
92
|
+
|
|
89
93
|
dev.add_method('turn_on',on)
|
|
90
94
|
dev.add_method('turn_off',off)
|
|
91
95
|
|
|
@@ -93,8 +97,8 @@ Let's take a look at a simple lamp device :
|
|
|
93
97
|
eng = Engine()
|
|
94
98
|
eng.add_device(dev)
|
|
95
99
|
eng.run()
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
|
|
101
|
+
|
|
98
102
|
FAQ
|
|
99
103
|
~~~
|
|
100
104
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
@@ -103,17 +107,17 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
103
107
|
|
|
104
108
|
* You can use you own loop and periodically call *eng.loop()*
|
|
105
109
|
for example, you can do something like this:
|
|
106
|
-
|
|
110
|
+
|
|
107
111
|
.. code:: python
|
|
108
|
-
|
|
112
|
+
|
|
109
113
|
while 1:
|
|
110
114
|
do_some_stuff()
|
|
111
115
|
eng.loop()
|
|
112
116
|
|
|
113
117
|
* You can use a engine timer, to perform some stuff.
|
|
114
|
-
|
|
118
|
+
|
|
115
119
|
.. code:: python
|
|
116
|
-
|
|
120
|
+
|
|
117
121
|
def read_io():
|
|
118
122
|
pass
|
|
119
123
|
|
|
@@ -126,6 +130,5 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
126
130
|
*coroutines* in device methods, timers functions and callbacks. It provides additionals features
|
|
127
131
|
like the *on_start* and *on_stop* callbacks.
|
|
128
132
|
|
|
129
|
-
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
130
|
-
apps/rest for a simple greenlet example.
|
|
131
|
-
|
|
133
|
+
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
134
|
+
apps/rest for a simple greenlet example.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
xaal.lib
|
|
3
3
|
========
|
|
4
4
|
**xaal.lib** is the official Python stack to develop home-automation devices and gateways
|
|
5
|
-
with the xAAL protocol. For a full description of the protocol check out
|
|
5
|
+
with the xAAL protocol. For a full description of the protocol check out
|
|
6
6
|
http://recherche.imt-atlantique.fr/xaal/
|
|
7
7
|
|
|
8
8
|
|
|
@@ -20,8 +20,8 @@ xaal.lib depends on :
|
|
|
20
20
|
|
|
21
21
|
Install
|
|
22
22
|
~~~~~~~
|
|
23
|
-
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
24
|
-
<https://redmine.
|
|
23
|
+
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
24
|
+
<https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7/README.html>`_
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
Usage
|
|
@@ -34,7 +34,7 @@ To receive / parse / display incoming xAAL messages, you can simply try somethin
|
|
|
34
34
|
this:
|
|
35
35
|
|
|
36
36
|
.. code-block:: python
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
from xaal.lib import Engine
|
|
39
39
|
|
|
40
40
|
def display(msg):
|
|
@@ -43,31 +43,31 @@ this:
|
|
|
43
43
|
eng = Engine()
|
|
44
44
|
eng.subscribe(display)
|
|
45
45
|
eng.run()
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
The Engine will call the display function every time it receive a xAAL message.
|
|
48
48
|
|
|
49
|
-
Let's take a look at a simple lamp device :
|
|
49
|
+
Let's take a look at a simple lamp device :
|
|
50
50
|
|
|
51
51
|
.. code-block:: python
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
from xaal.lib import Device,Engine,tools
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
# create and configure the lamp device, with a random address
|
|
56
|
-
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
56
|
+
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
57
57
|
dev.product_id = 'Dummy Lamp'
|
|
58
58
|
dev.url = 'http://www.acme.org'
|
|
59
59
|
dev.info = 'My fake lamp'
|
|
60
60
|
|
|
61
61
|
# add an xAAL attribute 'light'
|
|
62
62
|
light = dev.new_attribute('light')
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
# declare two device methods ON & OFF
|
|
65
65
|
def on():
|
|
66
66
|
light.value = True
|
|
67
67
|
|
|
68
68
|
def off():
|
|
69
69
|
light.value = False
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
dev.add_method('turn_on',on)
|
|
72
72
|
dev.add_method('turn_off',off)
|
|
73
73
|
|
|
@@ -75,8 +75,8 @@ Let's take a look at a simple lamp device :
|
|
|
75
75
|
eng = Engine()
|
|
76
76
|
eng.add_device(dev)
|
|
77
77
|
eng.run()
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
|
|
79
|
+
|
|
80
80
|
FAQ
|
|
81
81
|
~~~
|
|
82
82
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
@@ -85,17 +85,17 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
85
85
|
|
|
86
86
|
* You can use you own loop and periodically call *eng.loop()*
|
|
87
87
|
for example, you can do something like this:
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
.. code:: python
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
while 1:
|
|
92
92
|
do_some_stuff()
|
|
93
93
|
eng.loop()
|
|
94
94
|
|
|
95
95
|
* You can use a engine timer, to perform some stuff.
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
.. code:: python
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
def read_io():
|
|
100
100
|
pass
|
|
101
101
|
|
|
@@ -108,6 +108,5 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
108
108
|
*coroutines* in device methods, timers functions and callbacks. It provides additionals features
|
|
109
109
|
like the *on_start* and *on_stop* callbacks.
|
|
110
110
|
|
|
111
|
-
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
112
|
-
apps/rest for a simple greenlet example.
|
|
113
|
-
|
|
111
|
+
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
112
|
+
apps/rest for a simple greenlet example.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "xaal.lib"
|
|
3
|
+
version = "0.7.3"
|
|
4
|
+
description = "Official Python stack for xAAL protocol"
|
|
5
|
+
readme = "README.rst"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Jerome Kerdreux", email = "Jerome.Kerdreux@imt-atlantique.fr" },
|
|
8
|
+
]
|
|
9
|
+
license = { text = "GPL License" }
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python",
|
|
12
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
13
|
+
"Topic :: Home Automation",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
keywords = ['xaal', 'home-automation']
|
|
17
|
+
dependencies = [
|
|
18
|
+
'cbor2==5.4.2',
|
|
19
|
+
'pysodium',
|
|
20
|
+
'configobj',
|
|
21
|
+
'coloredlogs',
|
|
22
|
+
'decorator',
|
|
23
|
+
'tabulate',
|
|
24
|
+
'aioconsole',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://recherche.imt-atlantique.fr/xaal/"
|
|
30
|
+
Documentation = "https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/entry/code/Python/branches/0.7/libs/lib/README.rst"
|
|
31
|
+
Source = "https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/show/code/Python/branches/0.7/libs/lib"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
2
|
import cbor2
|
|
3
3
|
from cbor2 import CBORTag
|
|
4
|
-
|
|
5
|
-
from cbor2.decoder import CBORDecoder
|
|
4
|
+
from cbor2 import CBORDecoder
|
|
5
|
+
# from cbor2.decoder import CBORDecoder
|
|
6
6
|
|
|
7
7
|
from . import bindings
|
|
8
8
|
|
|
9
9
|
# ugly patch to remove default UUID decodeur
|
|
10
|
-
cbor2.
|
|
10
|
+
cbor2._decoder.semantic_decoders.pop(37)
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def tag_hook(decoder, tag, shareable_index=None):
|
|
@@ -17,6 +17,11 @@ def tag_hook(decoder, tag, shareable_index=None):
|
|
|
17
17
|
return bindings.URL(tag.value)
|
|
18
18
|
return tag
|
|
19
19
|
|
|
20
|
+
def object_hook(decoder, data):
|
|
21
|
+
#print("hook [%s]" % data)
|
|
22
|
+
return data
|
|
23
|
+
|
|
24
|
+
|
|
20
25
|
def default_encoder(encoder, value):
|
|
21
26
|
if isinstance(value,bindings.UUID):
|
|
22
27
|
encoder.encode(CBORTag(37, value.bytes))
|
|
@@ -29,7 +34,7 @@ def dumps(obj, **kwargs):
|
|
|
29
34
|
|
|
30
35
|
def loads(payload, **kwargs):
|
|
31
36
|
#return cbor2.loads(payload,tag_hook=tag_hook,**kwargs)
|
|
32
|
-
return _loads(payload,tag_hook=tag_hook,**kwargs)
|
|
37
|
+
return _loads(payload,tag_hook=tag_hook,object_hook=object_hook,**kwargs)
|
|
33
38
|
|
|
34
39
|
def _loads(s, **kwargs):
|
|
35
40
|
with BytesIO(s) as fp:
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xaal.lib
|
|
3
|
-
Version: 0.7.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.7.3
|
|
4
|
+
Summary: Official Python stack for xAAL protocol
|
|
5
5
|
Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
|
|
6
6
|
License: GPL License
|
|
7
|
+
Project-URL: Homepage, https://recherche.imt-atlantique.fr/xaal/
|
|
8
|
+
Project-URL: Documentation, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/entry/code/Python/branches/0.7/libs/lib/README.rst
|
|
9
|
+
Project-URL: Source, https://redmine.imt-atlantique.fr/projects/xaal/repository/xaal/show/code/Python/branches/0.7/libs/lib
|
|
7
10
|
Keywords: xaal,home-automation
|
|
8
11
|
Classifier: Programming Language :: Python
|
|
9
12
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Topic :: Home Automation
|
|
10
14
|
Description-Content-Type: text/x-rst
|
|
11
15
|
Requires-Dist: cbor2==5.4.2
|
|
12
16
|
Requires-Dist: pysodium
|
|
@@ -20,7 +24,7 @@ Requires-Dist: aioconsole
|
|
|
20
24
|
xaal.lib
|
|
21
25
|
========
|
|
22
26
|
**xaal.lib** is the official Python stack to develop home-automation devices and gateways
|
|
23
|
-
with the xAAL protocol. For a full description of the protocol check out
|
|
27
|
+
with the xAAL protocol. For a full description of the protocol check out
|
|
24
28
|
http://recherche.imt-atlantique.fr/xaal/
|
|
25
29
|
|
|
26
30
|
|
|
@@ -38,8 +42,8 @@ xaal.lib depends on :
|
|
|
38
42
|
|
|
39
43
|
Install
|
|
40
44
|
~~~~~~~
|
|
41
|
-
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
42
|
-
<https://redmine.
|
|
45
|
+
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
46
|
+
<https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7/README.html>`_
|
|
43
47
|
|
|
44
48
|
|
|
45
49
|
Usage
|
|
@@ -52,7 +56,7 @@ To receive / parse / display incoming xAAL messages, you can simply try somethin
|
|
|
52
56
|
this:
|
|
53
57
|
|
|
54
58
|
.. code-block:: python
|
|
55
|
-
|
|
59
|
+
|
|
56
60
|
from xaal.lib import Engine
|
|
57
61
|
|
|
58
62
|
def display(msg):
|
|
@@ -61,31 +65,31 @@ this:
|
|
|
61
65
|
eng = Engine()
|
|
62
66
|
eng.subscribe(display)
|
|
63
67
|
eng.run()
|
|
64
|
-
|
|
68
|
+
|
|
65
69
|
The Engine will call the display function every time it receive a xAAL message.
|
|
66
70
|
|
|
67
|
-
Let's take a look at a simple lamp device :
|
|
71
|
+
Let's take a look at a simple lamp device :
|
|
68
72
|
|
|
69
73
|
.. code-block:: python
|
|
70
|
-
|
|
74
|
+
|
|
71
75
|
from xaal.lib import Device,Engine,tools
|
|
72
|
-
|
|
76
|
+
|
|
73
77
|
# create and configure the lamp device, with a random address
|
|
74
|
-
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
78
|
+
dev = Device("lamp.basic", tools.get_random_uuid())
|
|
75
79
|
dev.product_id = 'Dummy Lamp'
|
|
76
80
|
dev.url = 'http://www.acme.org'
|
|
77
81
|
dev.info = 'My fake lamp'
|
|
78
82
|
|
|
79
83
|
# add an xAAL attribute 'light'
|
|
80
84
|
light = dev.new_attribute('light')
|
|
81
|
-
|
|
85
|
+
|
|
82
86
|
# declare two device methods ON & OFF
|
|
83
87
|
def on():
|
|
84
88
|
light.value = True
|
|
85
89
|
|
|
86
90
|
def off():
|
|
87
91
|
light.value = False
|
|
88
|
-
|
|
92
|
+
|
|
89
93
|
dev.add_method('turn_on',on)
|
|
90
94
|
dev.add_method('turn_off',off)
|
|
91
95
|
|
|
@@ -93,8 +97,8 @@ Let's take a look at a simple lamp device :
|
|
|
93
97
|
eng = Engine()
|
|
94
98
|
eng.add_device(dev)
|
|
95
99
|
eng.run()
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
|
|
101
|
+
|
|
98
102
|
FAQ
|
|
99
103
|
~~~
|
|
100
104
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
@@ -103,17 +107,17 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
103
107
|
|
|
104
108
|
* You can use you own loop and periodically call *eng.loop()*
|
|
105
109
|
for example, you can do something like this:
|
|
106
|
-
|
|
110
|
+
|
|
107
111
|
.. code:: python
|
|
108
|
-
|
|
112
|
+
|
|
109
113
|
while 1:
|
|
110
114
|
do_some_stuff()
|
|
111
115
|
eng.loop()
|
|
112
116
|
|
|
113
117
|
* You can use a engine timer, to perform some stuff.
|
|
114
|
-
|
|
118
|
+
|
|
115
119
|
.. code:: python
|
|
116
|
-
|
|
120
|
+
|
|
117
121
|
def read_io():
|
|
118
122
|
pass
|
|
119
123
|
|
|
@@ -126,6 +130,5 @@ exactly know what's going on. Anyways, you have several options to fix this issu
|
|
|
126
130
|
*coroutines* in device methods, timers functions and callbacks. It provides additionals features
|
|
127
131
|
like the *on_start* and *on_stop* callbacks.
|
|
128
132
|
|
|
129
|
-
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
130
|
-
apps/rest for a simple greenlet example.
|
|
131
|
-
|
|
133
|
+
* Use an alternate coroutine lib, you can use **gevent** or **greenlet** for example. Look at
|
|
134
|
+
apps/rest for a simple greenlet example.
|
xaal_lib-0.7.2/pyproject.toml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "xaal.lib"
|
|
3
|
-
version = "0.7.2"
|
|
4
|
-
description = "xaal.lib is the official Python stack of xAAL protocol dedicated to home automation systems"
|
|
5
|
-
readme = "README.rst"
|
|
6
|
-
authors = [ { name = "Jerome Kerdreux", email = "Jerome.Kerdreux@imt-atlantique.fr" } ]
|
|
7
|
-
license = { text = "GPL License"}
|
|
8
|
-
classifiers = ['Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules']
|
|
9
|
-
keywords = ['xaal', 'home-automation']
|
|
10
|
-
dependencies = ['cbor2==5.4.2', 'pysodium', 'configobj', 'coloredlogs', 'decorator', 'tabulate', 'aioconsole']
|
|
11
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|