See, that wasn't so hard! :-)
One suggestion: logging will change with WeeWX Version 4. See the Wiki
article *WeeWX v4 and logging
<https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging>*. To insure that
your driver will work under both WeeWX V3 and V4, take out the "import
syslog", then put this near the top of bme280wx.py:
try:
# Test for new-style weewx logging by trying to import weeutil.logger
import weeutil.logger
import logging
log = logging.getLogger(__name__)
def log_debug(message):
log.debug(message)
def log_info(message):
log.info(message)
def log_error(message):
log.error(message)
except ImportError:
# Old-style weewx logging
import syslog
def _log_message(destination, message):
syslog.syslog(destination, "bme280wx: {}".format(message))
def log_debug(message):
_log_message(syslog.LOG_DEBUG, message)
def log_info(message):
_log_message(syslog.LOG_INFO, message)
def log_error(message):
_log_message(syslog.LOG_ERR, message)
-tk
On Tue, Oct 15, 2019 at 11:06 PM Pieter Rautenbach <[email protected]>
wrote:
> Out of interest, here is my project:
> https://github.com/parautenbach/WeeWX-BME280
>
> It seems to be running so just monitoring to see if everything is fine.
>
> Being able to test the driver from the command line was useful and helped
> me to sort out a few issues.
>
> I'm pushing data to WU as IPARAD2.
>
> If anybody sees something odd (about my code or the data it's generating
> or anything that's not in line with the PWS community's expectations)
> please let me know. :-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-development/16bfaf3d-896d-4ab5-b71d-39ae7e2cee78%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-development/16bfaf3d-896d-4ab5-b71d-39ae7e2cee78%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/CAPq0zECeU%2BWQ%3DMTMqOFqQ%2BP3KszO0j7RrqGpU0yCPVn1i_ZrGA%40mail.gmail.com.