python-selve-new 2.1.5__tar.gz → 2.1.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.
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/PKG-INFO +1 -1
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/PKG-INFO +1 -1
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/__init__.py +27 -28
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/setup.py +1 -1
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/LICENSE +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/README.md +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/SOURCES.txt +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/dependency_links.txt +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/requires.txt +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/top_level.txt +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/__init__.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/command.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/device.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/event.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/group.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/iveo.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/param.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/senSim.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/sender.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/sensor.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/service.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/device.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/gateway.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/group.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/iveo.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/senSim.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/sender.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/sensor.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/__init__.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/errors.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/protocol.py +0 -0
- {python-selve-new-2.1.5 → python-selve-new-2.1.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-selve-new
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.7
|
|
4
4
|
Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
|
|
5
5
|
Home-page: https://github.com/Kannix2005/python-selve-new
|
|
6
6
|
Author: Stefan Altheimer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-selve-new
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.7
|
|
4
4
|
Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
|
|
5
5
|
Home-page: https://github.com/Kannix2005/python-selve-new
|
|
6
6
|
Author: Stefan Altheimer
|
|
@@ -77,62 +77,62 @@ class Selve:
|
|
|
77
77
|
self._LOGGER = logger
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
async def _worker(self
|
|
80
|
+
async def _worker(self):
|
|
81
81
|
# Infinite loop to collect all incoming data
|
|
82
|
-
|
|
82
|
+
self._LOGGER.debug("Worker started")
|
|
83
83
|
|
|
84
84
|
try:
|
|
85
85
|
while True:
|
|
86
|
-
if not
|
|
87
|
-
if not
|
|
88
|
-
async with
|
|
89
|
-
if not
|
|
90
|
-
|
|
91
|
-
if
|
|
86
|
+
if not self._pauseWorker:
|
|
87
|
+
if not self._pauseReader:
|
|
88
|
+
async with self._readLock:
|
|
89
|
+
if not self._serial.is_open:
|
|
90
|
+
self._serial.open()
|
|
91
|
+
if self._serial.in_waiting > 0:
|
|
92
92
|
msg = ""
|
|
93
93
|
while True:
|
|
94
|
-
response =
|
|
94
|
+
response = self._serial.readline().strip()
|
|
95
95
|
msg += response.decode()
|
|
96
96
|
if response.decode() == '':
|
|
97
97
|
break
|
|
98
98
|
|
|
99
99
|
# do something with the received data
|
|
100
|
-
await
|
|
100
|
+
await self.processResponse(msg)
|
|
101
101
|
|
|
102
102
|
# if msg.rstrip() == b' ':
|
|
103
|
-
|
|
103
|
+
self._LOGGER.debug(f'Received: {msg}')
|
|
104
104
|
else:
|
|
105
|
-
|
|
106
|
-
if not
|
|
107
|
-
if not
|
|
108
|
-
data: Command = await
|
|
105
|
+
self._LOGGER.debug("Reader stopped")
|
|
106
|
+
if not self._pauseWriter:
|
|
107
|
+
if not self.txQ.empty():
|
|
108
|
+
data: Command = await self.txQ.get()
|
|
109
109
|
commandstr = data.serializeToXML()
|
|
110
|
-
|
|
110
|
+
self._LOGGER.debug('Gateway writing: ' + str(commandstr))
|
|
111
111
|
try:
|
|
112
|
-
async with
|
|
113
|
-
if not
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
async with self._writeLock:
|
|
113
|
+
if not self._serial.is_open:
|
|
114
|
+
self._serial.open()
|
|
115
|
+
self._serial.write(commandstr)
|
|
116
|
+
self._serial.flush()
|
|
117
117
|
except Exception as e:
|
|
118
|
-
|
|
118
|
+
self._LOGGER.error("error communicating: " + str(e))
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
self.txQ.task_done()
|
|
121
121
|
|
|
122
122
|
# always sleep after writing
|
|
123
123
|
await asyncio.sleep(1)
|
|
124
124
|
else:
|
|
125
|
-
|
|
125
|
+
self._LOGGER.debug("Writer stopped")
|
|
126
126
|
await asyncio.sleep(0.01)
|
|
127
|
-
if
|
|
128
|
-
|
|
127
|
+
if self._stopThread:
|
|
128
|
+
self._LOGGER.debug('Exiting worker loop...')
|
|
129
129
|
break
|
|
130
130
|
return True
|
|
131
131
|
# serial port exceptions, all of these notify that we are in some
|
|
132
132
|
# serious trouble
|
|
133
133
|
except serial.SerialException:
|
|
134
134
|
# log message
|
|
135
|
-
|
|
135
|
+
self._LOGGER.error('Serial Port RX error')
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
async def setup(self, discover=False, fromConfigFlow=False):
|
|
@@ -223,7 +223,6 @@ class Selve:
|
|
|
223
223
|
self._pauseWorker = True
|
|
224
224
|
self._stopThread = True
|
|
225
225
|
if self.workerTask is not None and not self.workerTask.cancelled() and not self.workerTask.done():
|
|
226
|
-
self.workerTask.cancel()
|
|
227
226
|
await self.workerTask
|
|
228
227
|
self.workerTask = None
|
|
229
228
|
|
|
@@ -15,7 +15,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
|
|
|
15
15
|
setup(
|
|
16
16
|
|
|
17
17
|
name='python-selve-new', # Required
|
|
18
|
-
version='2.1.
|
|
18
|
+
version='2.1.7', # Required
|
|
19
19
|
description='Python library for interfacing with selve devices using the USB-RF controller. Written completely new.', # Required
|
|
20
20
|
long_description=long_description, # Optional
|
|
21
21
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/dependency_links.txt
RENAMED
|
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
|