diff --git a/sgp30/sgp30.py b/sgp30/sgp30.py index 04578e7..020c68c 100644 --- a/sgp30/sgp30.py +++ b/sgp30/sgp30.py @@ -9,7 +9,6 @@ import requests import os.path DEVICE_BUS = 1 -DEVICE_ADDR = 0x58 BASELINE_FILENAME = os.path.expanduser("~/sgp_config_data.txt") class _commands(): @@ -31,6 +30,12 @@ class _commands(): class Sgp30(): + def __init__(self,bus,device_address = 0x58): + self._bus = bus + self._device_addr = device_address + self.rw=partial(read_write,bus=bus) + self._start_time = time() + Sgp30Answer = namedtuple("Sgp30Answer",["data","raw"]) def read_write(cmd,bus,addr=DEVICE_ADDR):