Updated README.md and env.sample

This commit is contained in:
Fred Warren 2019-04-15 16:15:35 -07:00
parent c7aedd5b63
commit 7a027380f2
2 changed files with 34 additions and 13 deletions

View File

@ -2,18 +2,39 @@
When placed in a cron job this uppdater will make an https call to a json api to retrieve the co2 savings and equivenant trees planted and overlay those numbers on a graphic and upload them to the website. When placed in a cron job this uppdater will make an https call to a json api to retrieve the co2 savings and equivenant trees planted and overlay those numbers on a graphic and upload them to the website.
# Dependancies # Dependancies
* Python 3 and contents of `requirements.txt`. Python 3 and contents of `requirements.txt`.
* The font `Biko_Regular.otf`.
* A `.png` graphic to write text on.
* The package direnv and the follwing changes to the user account:
* [bash.rc] (https://github.com/direnv/direnv/wiki/Python#bash)
* [venv] (https://github.com/direnv/direnv/wiki/Python#venv-stdlib-module)
The font `Biko_Regular.otf`.
A `.png` graphic to write text on.
The package direnv and the follwing changes to the user account:
* bash.rc (https://github.com/direnv/direnv/wiki/Python#bash)
* venv (https://github.com/direnv/direnv/wiki/Python#venv-stdlib-module)
Assumes the use of direnv and ssh keys setup to upload graphic to website. If hosted on the website the ssh/scp portion can be replace with a copy.
`
import shutil
...
shutil.copy2(out_file, '/var/www/')
`
# Bulid Instructions # Bulid Instructions
copy `env.sample` to `.env` and edit assumes installed to `~/python/solar_edge`
`pip install -r requirements.txt` `
cd ~/python
git clone http://git.elder-geek.net/fredw/solar_edge.git
cd solar_edge
cp env.sample .env
direnv allow
pip install -r requirements.txt
`
user crontab edit `.env` and update accordingly
`05 * * * * cd ~/.venv/solar_edge && direnv exec . python solar_edge.py > /dev/null 2>&1`
add to user crontab to update site every 5 minutes
`
05 * * * * cd ~/python/solar_edge && direnv exec . python solar_edge.py > /dev/null 2>&1
`

View File

@ -1,7 +1,7 @@
SSH_HOST= SSH_HOST=
SSH_USER= SSH_USER=
SSH_FOLDER= SSH_FOLDER=
URL= URL=https://monitoringapi.solaredge.com/site/55555/envBenefits?systemUnits=Imperial&api_key=
INFILE= INFILE=environmental_benefits_blank.png
OUTFILE= OUTFILE=
FONT_FACE= FONT_FACE=Biko_Regular.otf