Skip to content

Commit

Permalink
handle negative temperatures
Browse files Browse the repository at this point in the history
bump to 0.1.2
  • Loading branch information
elric91 committed Feb 10, 2018
1 parent 29570f7 commit ecb1ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyzigate/attributes_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def interpret_attributes(self, msg_data):
ZGT_LOG.info(' * Sliding')
# Temperature
elif cluster_id == b'0402':
temperature = int(hexlify(attribute_data), 16) / 100
temperature = int.from_bytes(attribute_data, 'big', signed=True) / 100
#temperature = int(hexlify(attribute_data), 16) / 100
self.set_device_property(device_addr, endpoint, ZGT_TEMPERATURE, temperature)
ZGT_LOG.info(' * Measurement: Temperature'),
ZGT_LOG.info(' * Value: {} °C'.format(temperature))
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
setup(
name='pyzigate',
packages=['pyzigate'],
version='0.1.0',
version='0.1.2',
description='Interface library for ZiGate (http://zigate./fr)',
author='Frédéric HARS & Vesa YLIKYLÄ',
author_email='[email protected]',
url='https://github.com/elric91/ZiGate',
download_url='https://github.com/elric91/ZiGate/archive/v0.1.0-beta.tar.gz',
download_url='https://github.com/elric91/ZiGate/archive/v0.1.2.tar.gz',
keywords=['zigate', 'zigbee', 'python3'],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit ecb1ed4

Please sign in to comment.