Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_temper_devices():
"""Scan the Temper devices from temperusb."""
from temperusb.temper import TemperHandler
return TemperHandler().get_devices()
def get_temper_devices():
"""Scan the Temper devices from temperusb."""
return TemperHandler().get_devices()
def main():
args = parse_args()
quiet = args.celsius or args.fahrenheit or args.humidity
logging.basicConfig(level = logging.ERROR if quiet else logging.WARNING)
th = TemperHandler()
devs = th.get_devices()
if not quiet:
print("Found %i devices" % len(devs))
readings = []
for dev in devs:
if args.sensor_count is not None:
# Override auto-detection from args
dev.set_sensor_count(int(args.sensor_count))
if args.sensor_ids == 'all':
sensors = range(dev.get_sensor_count())
else:
sensors = [int(args.sensor_ids)]