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)]
def _get_temper_devices(self):
"""
Internal method.
Get attached TEMPer devices
:returns: list of attached TEMPer devices
:rtype: :class:`list` of :class:`temperusb.TemperDevice`
"""
th = temperusb.TemperHandler()
temper_devices = th.get_devices()
return temper_devices
def main():
sys.stdout = _unbuffered_handle(sys.stdout)
pp = snmp.PassPersist(".1.3.6.1.4.1")
logger = LogWriter()
upd = Updater(pp, logger, testmode=('--testmode' in sys.argv))
pp.start(upd.update, 5) # update every 5s
def main():
sys.stdout = _unbuffered_handle(sys.stdout)
pp = snmp.PassPersist(".1.3.6.1.4.1")
logger = LogWriter()
upd = Updater(pp, logger, testmode=('--testmode' in sys.argv))
pp.start(upd.update, 5) # update every 5s
def __init__(self):
self._devices = []
for vid, pid in VIDPIDS:
self._devices += [TemperDevice(device) for device in \
usb.core.find(find_all=True, idVendor=vid, idProduct=pid)]
LOGGER.info('Found {0} TEMPer devices'.format(len(self._devices)))