Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One likely fix, 2 cosmetic fixes, udev-rules-file #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions etc--udev--rules.d--24-TEMPer.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="7401", GROUP="plugdev", MODE="660"
ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="7402", GROUP="plugdev", MODE="660"
ATTRS{idVendor}=="413d", ATTRS{idProduct}=="2107", GROUP="plugdev", MODE="660"
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5523", GROUP="plugdev", MODE="660"
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e025", GROUP="plugdev", MODE="660"
ATTRS{idVendor}=="3553", ATTRS{idProduct}=="a001", GROUP="plugdev", MODE="660"
8 changes: 4 additions & 4 deletions temper.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _read_serial(self, device):

info = dict()
info['firmware'] = firmware
m = re.search(r'Temp-Inner:([0-9.]*).*, ?([0-9.]*)', reply)
m = re.search(r'Temp-Inner:([0-9.]*).*?, ?([0-9.]*)', reply)
if m is not None:
info['internal temperature'] = float(m.group(1))
info['internal humidity'] = float(m.group(2))
Expand Down Expand Up @@ -338,7 +338,7 @@ def __init__(self, verbose=False):
self.verbose = verbose

def _is_known_id(self, vendorid, productid):
'''Returns True if the vendorid and product id are valid.
'''Returns True if the vendorid and productid are valid.
'''

if self.forced_vendor_id is not None and \
Expand Down Expand Up @@ -479,8 +479,8 @@ def main(self):
except:
print('Cannot parse hexadecimal id: %s' % args.force)
return 1
self.forced_vendor_id = vendor_id;
self.forced_product_id = product_id;
self.forced_vendor_id = vendor_id
self.forced_product_id = product_id

# By default, output the temperature and humidity for all known sensors.
results = self.read(args.verbose)
Expand Down