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.
Files changed (32) hide show
  1. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/PKG-INFO +1 -1
  2. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/PKG-INFO +1 -1
  3. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/__init__.py +27 -28
  4. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/setup.py +1 -1
  5. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/LICENSE +0 -0
  6. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/README.md +0 -0
  7. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/SOURCES.txt +0 -0
  8. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/dependency_links.txt +0 -0
  9. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/requires.txt +0 -0
  10. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/python_selve_new.egg-info/top_level.txt +0 -0
  11. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/__init__.py +0 -0
  12. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/command.py +0 -0
  13. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/device.py +0 -0
  14. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/event.py +0 -0
  15. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/group.py +0 -0
  16. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/iveo.py +0 -0
  17. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/param.py +0 -0
  18. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/senSim.py +0 -0
  19. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/sender.py +0 -0
  20. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/sensor.py +0 -0
  21. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/commands/service.py +0 -0
  22. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/device.py +0 -0
  23. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/gateway.py +0 -0
  24. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/group.py +0 -0
  25. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/iveo.py +0 -0
  26. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/senSim.py +0 -0
  27. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/sender.py +0 -0
  28. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/sensor.py +0 -0
  29. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/__init__.py +0 -0
  30. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/errors.py +0 -0
  31. {python-selve-new-2.1.5 → python-selve-new-2.1.7}/selve/util/protocol.py +0 -0
  32. {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.5
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.5
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, selve: Selve, queue: asyncio.Queue):
80
+ async def _worker(self):
81
81
  # Infinite loop to collect all incoming data
82
- selve._LOGGER.debug("Worker started")
82
+ self._LOGGER.debug("Worker started")
83
83
 
84
84
  try:
85
85
  while True:
86
- if not selve._pauseWorker:
87
- if not selve._pauseReader:
88
- async with selve._readLock:
89
- if not selve._serial.is_open:
90
- selve._serial.open()
91
- if selve._serial.in_waiting > 0:
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 = selve._serial.readline().strip()
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 selve.processResponse(msg)
100
+ await self.processResponse(msg)
101
101
 
102
102
  # if msg.rstrip() == b' ':
103
- selve._LOGGER.debug(f'Received: {msg}')
103
+ self._LOGGER.debug(f'Received: {msg}')
104
104
  else:
105
- selve._LOGGER.debug("Reader stopped")
106
- if not selve._pauseWriter:
107
- if not selve.txQ.empty():
108
- data: Command = await queue.get()
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
- selve._LOGGER.debug('Gateway writing: ' + str(commandstr))
110
+ self._LOGGER.debug('Gateway writing: ' + str(commandstr))
111
111
  try:
112
- async with selve._writeLock:
113
- if not selve._serial.is_open:
114
- selve._serial.open()
115
- selve._serial.write(commandstr)
116
- selve._serial.flush()
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
- selve._LOGGER.error("error communicating: " + str(e))
118
+ self._LOGGER.error("error communicating: " + str(e))
119
119
 
120
- queue.task_done()
120
+ self.txQ.task_done()
121
121
 
122
122
  # always sleep after writing
123
123
  await asyncio.sleep(1)
124
124
  else:
125
- selve._LOGGER.debug("Writer stopped")
125
+ self._LOGGER.debug("Writer stopped")
126
126
  await asyncio.sleep(0.01)
127
- if selve._stopThread:
128
- selve._LOGGER.debug('Exiting worker loop...')
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
- selve._LOGGER.error('Serial Port RX error')
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.5', # Required
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",