Right you are! Fixed in commit febcf85
<https://github.com/weewx/weewx/commit/febcf851ce83b8297842ca8a473418f0f1ef03ba>
.

Thanks, Bob.

On Tue, Feb 26, 2019 at 8:39 AM bob_linux_user <[email protected]> wrote:

> I located an error in vantage.py. I do not know if this has been reported
> but in setCalibrationHumid the "If" statement left out the "not" and the
> results is that "offset" in the range of -100 to 100 is rejected as being
> out of range when attempting to use "wee_device --set-offset". The
> corrected code is below:
>
> *def setCalibrationHumid(self, variable, offset):*
>
> *        """Set an on-board humidity calibration."""*
>
> *        # Offset is in percentage points.*
>
> *        if not -100 <= offset <= 100:*
>
> *            raise weewx.ViolatedPrecondition("Offset %d out of range
> [-100, 100]." % offset)*
>
> *        byte = struct.pack("b", offset)*
>
> *        variable_dict = { 'inHumid': 0x44, 'outHumid': 0x45 }*
>
> *        for i in range(1, 8): variable_dict['extraHumid%d' % i] = 0x45 +
> i*
>
> *        if variable in variable_dict:*
>
> *            self.port.send_data(b"EEBWR %X 01\n" %
> variable_dict[variable])*
>
> *            self.port.send_data_with_crc16(byte, max_tries=1)*
>
> *        else:*
>
> *            raise weewx.ViolatedPrecondition("Variable name %s not known"
> % variable)*
>
> *        syslog.syslog(syslog.LOG_NOTICE, "vantage: Humidity calibration
> %s set to %d" % (variable, offset))*
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to