Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.5, 3.6, 3.7, 3.8]
python: [3.6, 3.7, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,5 +33,5 @@ jobs:
run: |
python -m pip install coveralls
coveralls --service=github
if: ${{ matrix.python == '3.8' }}
if: ${{ matrix.python == '3.9' }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ curl -sSL https://get.pimoroni.com/enviroplus | bash

## Or... Install from PyPi and configure manually:

* Run `sudo pip install enviroplus`
* Run `sudo python3 -m pip install enviroplus`

**Note** this wont perform any of the required configuration changes on your Pi, you may additionally need to:

Expand Down
4 changes: 2 additions & 2 deletions examples/luftdaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def send_to_luftdaten(values, id):

resp_pm = None
resp_bmp = None

try:
resp_pm = requests.post(
"https://api.luftdaten.info/v1/push-sensor-data/",
Expand All @@ -150,7 +150,7 @@ def send_to_luftdaten(values, id):
except requests.exceptions.RequestException as e:
logging.warning('Luftdaten PM Request Error: {}'.format(e))

try:
try:
resp_bmp = requests.post(
"https://api.luftdaten.info/v1/push-sensor-data/",
json={
Expand Down
7 changes: 4 additions & 3 deletions examples/mqtt-all.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
"""
Run mqtt broker on localhost: sudo apt-get install mosquitto mosquitto-clients

Example run: python3 mqtt-all.py --broker 192.168.1.164 --topic enviro --username xxx --password xxxx
"""
#!/usr/bin/env python3

import argparse
import ST7735
Expand Down Expand Up @@ -43,6 +43,7 @@
DEFAULT_USERNAME = None
DEFAULT_PASSWORD = None


# mqtt callbacks
def on_connect(client, userdata, flags, rc):
if rc == 0:
Expand Down Expand Up @@ -99,7 +100,7 @@ def get_cpu_temperature():
["vcgencmd", "measure_temp"], stdout=PIPE, universal_newlines=True
)
output, _error = process.communicate()
return float(output[output.index("=") + 1 : output.rindex("'")])
return float(output[output.index("=") + 1:output.rindex("'")])


# Get Raspberry Pi serial number to use as ID
Expand Down Expand Up @@ -240,7 +241,7 @@ def main():
HAS_PMS = False
try:
pms5003 = PMS5003()
pm_values = pms5003.read()
_ = pms5003.read()
HAS_PMS = True
print("PMS5003 sensor is connected")
except SerialTimeoutError:
Expand Down
11 changes: 3 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ printf "$LIBRARY_NAME $LIBRARY_VERSION Python Library: Installer\n\n"

cd library

printf "Installing for Python 2..\n"
apt_pkg_install "${PY2_DEPS[@]}"
python setup.py install > /dev/null
if [ $? -eq 0 ]; then
success "Done!\n"
echo "pip uninstall $LIBRARY_NAME" >> $UNINSTALLER
fi

if [ -f "/usr/bin/python3" ]; then
printf "Installing for Python 3..\n"
apt_pkg_install "${PY3_DEPS[@]}"
Expand All @@ -155,6 +147,9 @@ if [ -f "/usr/bin/python3" ]; then
success "Done!\n"
echo "pip3 uninstall $LIBRARY_NAME" >> $UNINSTALLER
fi
else
printf "/usr/bin/python3 not found. Unable to install!\n"
exit 1
fi

cd $WD
Expand Down
5 changes: 5 additions & 0 deletions library/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.0.5
-----

* Drop Python 2.x support

0.0.4
-----

Expand Down
8 changes: 7 additions & 1 deletion library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ curl -sSL https://get.pimoroni.com/enviroplus | bash

## Or... Install from PyPi and configure manually:

* Run `sudo pip install enviroplus`
* Run `sudo python3 -m pip install enviroplus`

**Note** this wont perform any of the required configuration changes on your Pi, you may additionally need to:

Expand Down Expand Up @@ -70,6 +70,12 @@ sudo apt install python-numpy python-smbus python-pil python-setuptools
* Discord - https://discord.gg/hr93ByC

# Changelog

0.0.5
-----

* Drop Python 2.x support

0.0.4
-----

Expand Down
2 changes: 1 addition & 1 deletion library/enviroplus/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.4'
__version__ = '0.0.5'
12 changes: 2 additions & 10 deletions library/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
[metadata]
name = enviroplus
version = 0.0.4
version = 0.0.5
author = Philip Howard
author_email = phil@pimoroni.com
description = Enviro pHAT Plus environmental monitoring add-on for Raspberry Pi
Expand All @@ -20,13 +20,13 @@ classifiers =
Operating System :: POSIX :: Linux
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Topic :: Software Development
Topic :: Software Development :: Libraries
Topic :: System :: Hardware

[options]
python_requires = >= 3.6
packages = enviroplus
install_requires =
pimoroni-bme280
Expand Down Expand Up @@ -54,14 +54,6 @@ ignore =

[pimoroni]
py2deps =
python-pip
python-numpy
python-smbus
python-pil
python-cffi
python-spidev
python-rpi.gpio
libportaudio2
py3deps =
python3-pip
python3-numpy
Expand Down
2 changes: 1 addition & 1 deletion library/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,35},qa
envlist = py{36, 37, 38, 39},qa
skip_missing_interpreters = True

[testenv]
Expand Down