Skip to content

Commit

Permalink
Removed env file for easy git pull upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Apr 16, 2022
1 parent 1e002de commit dcbffe3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ You will want to set your local timezone by editing `pypowerwall.env`, `influxdb

### Docker Containers

* Edit `pypowerwall.env` and update the following details for your Powerwall:
* Rename `pypowerwall.sample` to `pypowerwall.env` and update the following details for your Powerwall:

```yml
PW_PASSWORD: "password"
PW_EMAIL: "email@example.com"
PW_HOST: "192.168.91.1"
PW_TIMEZONE: "America/Los_Angeles"
PW_DEBUG: "yes"
PW_DEBUG: "no"
```

Expand All @@ -76,7 +76,7 @@ You will want to set your local timezone by editing `pypowerwall.env`, `influxdb
docker exec -it influxdb influx -import -path=/var/lib/influxdb/influxdb.sql
```

Note: the influxdb.sql file is set to use `America/Los_Angeles` as timezone. Use the `tz.sh` script or manually update the database commands above to replace `America/Los_Angeles` with your own timezone.
Note: It can take a while for InfluxDB to start. Also the influxdb.sql file is set to use `America/Los_Angeles` as timezone. Use the `tz.sh` script or manually update the database commands above to replace `America/Los_Angeles` with your own timezone.

## Grafana Setup

Expand Down
2 changes: 1 addition & 1 deletion pypowerwall.env → pypowerwall.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PW_PASSWORD: "password"
PW_EMAIL: "email@example.com"
PW_HOST: "192.168.91.1"
PW_TIMEZONE: "America/Los_Angeles"
PW_DEBUG: "yes"
PW_DEBUG: "no"
30 changes: 21 additions & 9 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ read -p 'Timezone (default America/Los_Angeles): ' TZ
echo ""

# Powerwall Credentials
echo "Current Powerwall Credentials:"
echo ""
cat ${ENV_FILE}
echo ""
read -r -p "Update these credentials? [Y/n] " response
if [[ "$response" =~ ^([nN][oO]|[nN])$ ]]
then
echo "Using existing ${ENV_FILE}."
else
if [ ! -f ${ENV_FILE} ]; then
echo "Enter credentials for Powerwall..."
read -p 'Password: ' PASSWORD
read -p 'Email: ' EMAIL
Expand All @@ -50,6 +42,26 @@ else
echo "PW_HOST=${IP}" >> ${ENV_FILE}
echo "PW_TIMEZONE=${TZ}" >> ${ENV_FILE}
echo "PW_DEBUG=no" >> ${ENV_FILE}
else
echo "Current Powerwall Credentials:"
echo ""
cat ${ENV_FILE}
echo ""
read -r -p "Update these credentials? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
echo "Using existing ${ENV_FILE}."
else
echo "Enter credentials for Powerwall..."
read -p 'Password: ' PASSWORD
read -p 'Email: ' EMAIL
read -p 'IP Address: ' IP
echo "PW_EMAIL=${EMAIL}" > ${ENV_FILE}
echo "PW_PASSWORD=${PASSWORD}" >> ${ENV_FILE}
echo "PW_HOST=${IP}" >> ${ENV_FILE}
echo "PW_TIMEZONE=${TZ}" >> ${ENV_FILE}
echo "PW_DEBUG=no" >> ${ENV_FILE}
fi
fi

echo ""
Expand Down

0 comments on commit dcbffe3

Please sign in to comment.