'Return the state of the sensor.'

@property
def state(self):

    try:
        tag = self._port.tag
    except ValueError:
        tag = None
    if (tag is None):
        return STATE_OFF
    elif (self._port.model == 'Input    Digital'):
        return (STATE_ON if (self._port.value > 0) else STATE_OFF)
    digits = DIGITS.get(self._port.tag, 0)
    return round(self._port.value, digits)
