Skip to main content

Gets your weather data for a 16x2 display on raspberry pi

Project description

Installation:

You can either get the source code and include it in your application manlually, or use can use pip instead.

pip install iwPiWeather

Or depending on your raspberry config for python3 you might need to run

pip3 install iwPiWeather

Use example:

Include your package, define the pins and initialize the thread

import iwPiWeather

displayPinout = { "rs": 22, "en": 17, "d7": 18, "d6": 23, "d5": 24, "d4": 25 }
weather = iwPiWeather.weatherDisplay(apiKey='passyouroowmapikey', poolRate=120, dispPins=displayPinout, autoStart=True)

You can pass the following arguments in the constructor:

  • apiKey - Required field, you need to provide the OpenWeatherMap API key.

  • poolRate - Time to wait between each call to the OpenWeatherMap API.

  • dispPins - Layout of the display pins connection

  • autoStart - If this is toggled off, the thread will start in sleep mode, and no calls will be made until the thread is manually started.

The created weather object will be actually a thread that runs in the background. So you can integrate this functionality in your application, this will run as a background process in a separate thread.

You can temporarily pause the display update thread by calling weather.stopWatch() which will allow you for example to stop pooling and displaying the weather data on the display and use the display for something else in your integration.

To restart the thread and keep reprinting the weather data you can use weather.startWatch()

To stop the thread and cleanup the object you can call weather.stopThread(). This will kill the thread and you can safely stop the application.

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

iwPiWeather-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file iwPiWeather-0.1.0.tar.gz.

File metadata

  • Download URL: iwPiWeather-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for iwPiWeather-0.1.0.tar.gz
Algorithm Hash digest
SHA256 693c72976526f833de8edde0440e90fe91c88325b78ca7b958ab55eacfe8d133
MD5 33d19c23c43811c14337412f2f7151c9
BLAKE2b-256 e36b6ad59d1faf0403e671b551d67f7306cacad7096d07b2249a3f5087fb77f8

See more details on using hashes here.

Supported by

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