# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyupm_tex00', [dirname(__file__)])
except ImportError:
import _pyupm_tex00
return _pyupm_tex00
if fp is not None:
try:
_mod = imp.load_module('_pyupm_tex00', fp, pathname, description)
finally:
fp.close()
return _mod
_pyupm_tex00 = swig_import_helper()
del swig_import_helper
else:
import _pyupm_tex00
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
if (not static):
return object.__getattr__(self, name)
else:
raise AttributeError(name)
def _swig_getattr(self, class_type, name):
return _swig_getattr_nondynamic(self, class_type, name, 0)
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object:
pass
_newclass = 0
def getVersion():
return _pyupm_tex00.getVersion()
getVersion = _pyupm_tex00.getVersion
_pyupm_tex00.TEX00_DEFAULT_AREF_swigconstant(_pyupm_tex00)
TEX00_DEFAULT_AREF = _pyupm_tex00.TEX00_DEFAULT_AREF
[docs]class TEX00(_object):
"""
API for the Veris TEX00 Temperature Sensor.
ID: tex00
Name: Veris TEX00 Temperature Sensors
Category: temp
Manufacturer: veris
Connection: analog
Link:http://www.veris.com/Item/TED00.aspx The Veris TEX00 temperature
sensor family is made up of a series of RTD thermistors in wall mount
packaging.
This driver was developed using the TED00, which utilizes a 10K Ohm
Type 2 thermistor. However, this driver can support the other 12
variants of the TE series as well by providing the correct sensor type
to the class constructor. These other sensor types have not been
tested. Only the TED00 was tested with this driver.
This sensor must be connected as part of a voltage divider, with the
balancing resistor ideally matched to the sensor's 25C detection
range. For the TED00 (10kt2), a 10K Ohm (1% tolerance) resistor was
used in a circuit like the following:
GND o-|TED00(10k2)|-o-|balanceResistor(10K)|-o VCC (+5vdc) | | |-o A0
(analog input to MCU)
A 3.3vdc voltage can be used as well if desired.
C++ includes: tex00.hpp
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, TEX00, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, TEX00, name)
__repr__ = _swig_repr
STYPE_THERMISTOR_TED = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TED
STYPE_THERMISTOR_TEB = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEB
STYPE_THERMISTOR_TEC = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEC
STYPE_THERMISTOR_TEI = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEI
STYPE_THERMISTOR_TEE = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEE
STYPE_THERMISTOR_TEF = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEF
STYPE_THERMISTOR_TEH = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEH
STYPE_THERMISTOR_TEJ = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEJ
STYPE_THERMISTOR_TES = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TES
STYPE_THERMISTOR_TER = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TER
STYPE_THERMISTOR_TEM = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEM
STYPE_THERMISTOR_TEU = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TEU
STYPE_THERMISTOR_TET = _pyupm_tex00.TEX00_STYPE_THERMISTOR_TET
def __init__(self, tPin, balanceResistor, stype, aref=5.0):
"""
TEX00(int tPin, float
balanceResistor, SENSOR_TYPES_T stype, float aref=TEX00_DEFAULT_AREF)
TEX00 object constructor
Parameters:
-----------
tPin: Analog pin to use for temperature.
balanceResistor: Resistance (in Ohms) of the balance resistor used in
your voltage divider.
stype: The sensor type. One of the SENSOR_TYPES_T values.
aref: The analog reference voltage, default 5.0
"""
this = _pyupm_tex00.new_TEX00(tPin, balanceResistor, stype, aref)
try:
self.this.append(this)
except Exception:
self.this = this
__swig_destroy__ = _pyupm_tex00.delete_TEX00
__del__ = lambda self: None
[docs] def update(self):
"""
void update()
Read current values from the sensor and update internal stored values.
This method must be called prior to querying any values, such as
temperature.
"""
return _pyupm_tex00.TEX00_update(self)
[docs] def getTemperature(self, fahrenheit=False):
"""
float
getTemperature(bool fahrenheit=false)
Get the current temperature. update() must have been called prior to
calling this method.
Parameters:
-----------
fahrenheit: true to return the temperature in degrees fahrenheit,
false to return the temperature in degrees celsius. The default is
false (degrees Celsius).
The last temperature reading in Celsius or Fahrenheit
"""
return _pyupm_tex00.TEX00_getTemperature(self, fahrenheit)
[docs] def getTemperatureRangeMin(self):
"""
float
getTemperatureRangeMin()
Return the smallest temperature that can be measured by the current
sensor.
The smallest detectable temperature this sensor can measure, in C.
"""
return _pyupm_tex00.TEX00_getTemperatureRangeMin(self)
[docs] def getTemperatureRangeMax(self):
"""
float
getTemperatureRangeMax()
Return the largest temperature that can be measured by the current
sensor.
The largest detectable temperature this sensor can measure, in C.
"""
return _pyupm_tex00.TEX00_getTemperatureRangeMax(self)
[docs] def isOutOfRange(self):
"""
bool isOutOfRange()
Detect whether the last measurement exceeded the sensors detection
range. update() must have been called prior to calling this method.
true if the last measurement was out of range, false otherwise.
"""
return _pyupm_tex00.TEX00_isOutOfRange(self)
TEX00_swigregister = _pyupm_tex00.TEX00_swigregister
TEX00_swigregister(TEX00)
# This file is compatible with both classic and new-style classes.