xaal.lib 0.7.6__tar.gz → 0.7.7__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.6 → xaal_lib-0.7.7}/PKG-INFO +19 -2
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/README.rst +18 -1
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/pyproject.toml +1 -1
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/devices.py +7 -7
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal.lib.egg-info/PKG-INFO +19 -2
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/setup.cfg +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_bindings.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_cbor.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_device.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_engine.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_message.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/tests/test_tools.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/__init__.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/__init__.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/__main__.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/aioengine.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/aiohelpers.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/aionetwork.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/bindings.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/cbor.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/config.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/core.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/engine.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/exceptions.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/helpers.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/messages.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/network.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/test.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal/lib/tools.py +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal.lib.egg-info/SOURCES.txt +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal.lib.egg-info/dependency_links.txt +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal.lib.egg-info/requires.txt +0 -0
- {xaal_lib-0.7.6 → xaal_lib-0.7.7}/xaal.lib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xaal.lib
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.7
|
|
4
4
|
Summary: Official Python stack for xAAL protocol
|
|
5
5
|
Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
|
|
6
6
|
License: GPL License
|
|
@@ -43,7 +43,7 @@ xaal.lib depends on :
|
|
|
43
43
|
Install
|
|
44
44
|
~~~~~~~
|
|
45
45
|
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
46
|
-
<https://
|
|
46
|
+
<https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/README.rst>`_
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
Usage
|
|
@@ -99,6 +99,23 @@ Let's take a look at a simple lamp device :
|
|
|
99
99
|
eng.run()
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
To avoid to rewrite the same code for each device, you can use the `xaal.schemas package <https://gitlab.imt-atlantique.fr/xaal/code/python/-/tree/main/libs/schemas>`_.
|
|
103
|
+
This package provides a set of predefined devices, you can use them as a template to create your own device.
|
|
104
|
+
|
|
105
|
+
.. code-block:: python
|
|
106
|
+
|
|
107
|
+
from xaal.schemas import devices
|
|
108
|
+
from xaal.lib import Engine
|
|
109
|
+
|
|
110
|
+
# create and configure the lamp device
|
|
111
|
+
dev = devices.lamp()
|
|
112
|
+
|
|
113
|
+
# last step, create an engine and register the lamp
|
|
114
|
+
eng = Engine()
|
|
115
|
+
eng.add_device(dev)
|
|
116
|
+
eng.run()
|
|
117
|
+
|
|
118
|
+
|
|
102
119
|
FAQ
|
|
103
120
|
~~~
|
|
104
121
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
@@ -21,7 +21,7 @@ xaal.lib depends on :
|
|
|
21
21
|
Install
|
|
22
22
|
~~~~~~~
|
|
23
23
|
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
24
|
-
<https://
|
|
24
|
+
<https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/README.rst>`_
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
Usage
|
|
@@ -77,6 +77,23 @@ Let's take a look at a simple lamp device :
|
|
|
77
77
|
eng.run()
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
To avoid to rewrite the same code for each device, you can use the `xaal.schemas package <https://gitlab.imt-atlantique.fr/xaal/code/python/-/tree/main/libs/schemas>`_.
|
|
81
|
+
This package provides a set of predefined devices, you can use them as a template to create your own device.
|
|
82
|
+
|
|
83
|
+
.. code-block:: python
|
|
84
|
+
|
|
85
|
+
from xaal.schemas import devices
|
|
86
|
+
from xaal.lib import Engine
|
|
87
|
+
|
|
88
|
+
# create and configure the lamp device
|
|
89
|
+
dev = devices.lamp()
|
|
90
|
+
|
|
91
|
+
# last step, create an engine and register the lamp
|
|
92
|
+
eng = Engine()
|
|
93
|
+
eng.add_device(dev)
|
|
94
|
+
eng.run()
|
|
95
|
+
|
|
96
|
+
|
|
80
97
|
FAQ
|
|
81
98
|
~~~
|
|
82
99
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
@@ -44,7 +44,7 @@ class Attribute(object):
|
|
|
44
44
|
|
|
45
45
|
@value.setter
|
|
46
46
|
def value(self, value):
|
|
47
|
-
if value != self.__value:
|
|
47
|
+
if value != self.__value and self.device:
|
|
48
48
|
eng = self.device.engine
|
|
49
49
|
if eng:
|
|
50
50
|
eng.add_attributes_change(self)
|
|
@@ -53,7 +53,7 @@ class Attribute(object):
|
|
|
53
53
|
|
|
54
54
|
def __repr__(self): # pragma: no cover
|
|
55
55
|
return f"<{self.__module__}.Attribute {self.name} at 0x{id(self):x}>"
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
|
|
58
58
|
class Attributes(list):
|
|
59
59
|
"""Devices owns a attributes list. This list also have dict-like access"""
|
|
@@ -65,7 +65,7 @@ class Attributes(list):
|
|
|
65
65
|
if (value == k.name):
|
|
66
66
|
return k.value
|
|
67
67
|
raise KeyError(value)
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
def __setitem__(self,name,value):
|
|
70
70
|
if isinstance(name,int):
|
|
71
71
|
return list.__setitem__(self,name,value)
|
|
@@ -74,7 +74,7 @@ class Attributes(list):
|
|
|
74
74
|
k.value = value
|
|
75
75
|
return
|
|
76
76
|
raise KeyError(name)
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
class Device(object):
|
|
79
79
|
|
|
80
80
|
__slots__ = ['__dev_type','__address','group_id',
|
|
@@ -96,7 +96,7 @@ class Device(object):
|
|
|
96
96
|
self.__url = None # product URL
|
|
97
97
|
self.schema = None # schema URL
|
|
98
98
|
self.info = None # additionnal info
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
# Unsupported stuffs
|
|
101
101
|
self.unsupported_attributes = []
|
|
102
102
|
self.unsupported_methods = []
|
|
@@ -166,7 +166,7 @@ class Device(object):
|
|
|
166
166
|
if attr:
|
|
167
167
|
self.__attributes.append(attr)
|
|
168
168
|
attr.device = self
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
def del_attribute(self,attr):
|
|
171
171
|
if attr:
|
|
172
172
|
attr.device = None
|
|
@@ -215,7 +215,7 @@ class Device(object):
|
|
|
215
215
|
for k,v in self._get_description().items():
|
|
216
216
|
r.append([k,v])
|
|
217
217
|
print(tabulate(r,tablefmt="fancy_grid"))
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
# attributes
|
|
220
220
|
if len(self._get_attributes()) > 0:
|
|
221
221
|
r = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xaal.lib
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.7
|
|
4
4
|
Summary: Official Python stack for xAAL protocol
|
|
5
5
|
Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
|
|
6
6
|
License: GPL License
|
|
@@ -43,7 +43,7 @@ xaal.lib depends on :
|
|
|
43
43
|
Install
|
|
44
44
|
~~~~~~~
|
|
45
45
|
Please refer to the official `full documentation to install the lib in a virtualenv
|
|
46
|
-
<https://
|
|
46
|
+
<https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/README.rst>`_
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
Usage
|
|
@@ -99,6 +99,23 @@ Let's take a look at a simple lamp device :
|
|
|
99
99
|
eng.run()
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
To avoid to rewrite the same code for each device, you can use the `xaal.schemas package <https://gitlab.imt-atlantique.fr/xaal/code/python/-/tree/main/libs/schemas>`_.
|
|
103
|
+
This package provides a set of predefined devices, you can use them as a template to create your own device.
|
|
104
|
+
|
|
105
|
+
.. code-block:: python
|
|
106
|
+
|
|
107
|
+
from xaal.schemas import devices
|
|
108
|
+
from xaal.lib import Engine
|
|
109
|
+
|
|
110
|
+
# create and configure the lamp device
|
|
111
|
+
dev = devices.lamp()
|
|
112
|
+
|
|
113
|
+
# last step, create an engine and register the lamp
|
|
114
|
+
eng = Engine()
|
|
115
|
+
eng.add_device(dev)
|
|
116
|
+
eng.run()
|
|
117
|
+
|
|
118
|
+
|
|
102
119
|
FAQ
|
|
103
120
|
~~~
|
|
104
121
|
The core engine run forever so how can I use it in webserver, GUI or to develop device
|
|
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
|