Closed jscheidtmann closed 7 months ago
Looking at the read_bme280 script, the minimal script to read a sensor data from Python is:
from bme280 import bme280, bme280_i2c bme280_i2c.set_default_i2c_address(0x76) bme280_i2c.set_default_bus(1) bme280.setup() data = bme280.read_all()
Instead I would expect the following minimal script, which would make it honor Python unspoken standards (cf. import statistics):
import statistics
import bme280 bme280.setup() # or bme280.setup(0x76, 1) data = bme280.read_all()
This avoids exposing the i2c class, so that once a SPI class becomes available as a backend, it'll be easier to switch.
Released as 0.7. Unfortunately I no longer have this setup so I am unable to test it, please let me know if it doesn't work for some reason.
Looking at the read_bme280 script, the minimal script to read a sensor data from Python is:
Instead I would expect the following minimal script, which would make it honor Python unspoken standards (cf.
import statistics
):This avoids exposing the i2c class, so that once a SPI class becomes available as a backend, it'll be easier to switch.