Skip to content

Commit

Permalink
onewire: Added a "sleep-time" for testing to improve io_cycle reading…
Browse files Browse the repository at this point in the history
… for parasite powered devices; Bumped version to 1.9.4
  • Loading branch information
msinn committed Mar 31, 2023
1 parent ce2c56d commit 4bd7429
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions onewire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class OneWire(SmartPlugin):
the update functions for the items
"""

PLUGIN_VERSION = '1.9.3'
PLUGIN_VERSION = '1.9.4'

_flip = {0: '1', False: '1', 1: '0', True: '0', '0': True, '1': False}

Expand Down Expand Up @@ -304,12 +304,13 @@ def _io_cycle(self):
value = (addr in entries)
else:
value = self._flip[self.owbase.read('/uncached' + path).decode()]
self.stopevent.wait(self._parasitic_power_wait)
except ConnectionError as e:
self.logger.warning(f"_io_cycle: 'raise' {self._ios[addr][key]['readerrors']}. problem connecting to {addr}-{key}, error: {e}")
raise
except Exception as e:
# time.sleep(self._parasitic_power_wait)
self.stopevent.wait(self._parasitic_power_wait)
#self.stopevent.wait(self._parasitic_power_wait)
self._ios[addr][key]['readerrors'] = self._ios[addr][key].get('readerrors', 0) + 1
if self._ios[addr][key]['readerrors'] % self.warn_after == 0:
self.logger.warning(f"_io_cycle: {self._ios[addr][key]['readerrors']}. problem reading {addr}-{key}, error: {e}")
Expand Down
2 changes: 1 addition & 1 deletion onewire/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugin:
keywords: 1wire onewire dallas ibutton sensor temperature humidity
documentation: ''
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1493319-support-thread-zum-onewire-plugin
version: 1.9.3 # Plugin version
version: 1.9.4 # Plugin version
sh_minversion: 1.9.3.5 # minimum shNG version to use this plugin
multi_instance: True
restartable: True
Expand Down

0 comments on commit 4bd7429

Please sign in to comment.