Skip to main content

A library to interface with ZyTemp devices

Project description

pyzytemp

ZyTemp devices are simple serial communication devices that can measure basic properties about the world around them. This library provides a method for interfacing with these devices and retrieving measurements from them.

Devices powered by ZyTemp include:

Different devices have different capabilities, but in theory ZyTemp devices can report:

  • Temperature
  • CO2 concentration
  • Relative humidity

Installation

pip install pyzytemp

Examples

Streaming value from a device:

import pyzytemp
device = pyzytemp.find()[0]
for measurement, value in device.stream():
    if measurement == pyzytemp.Measurement.CO2:
        print(f"Current CO2 level: {value:.0f} PPM")

Polling for recent values from a device:

import time
import pyzytemp
device = pyzytemp.find()[0]
for _ in range(32):
    time.sleep(1)
    temp = device.get_last_temperature_c()
    if temp is not None:
        print(f"Last recorded temperature: {temp:.2f}C")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzytemp-0.0.1.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

pyzytemp-0.0.1-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page