8000 Platform independence + changes to incorporate new dict in vehiclestatus by davidfhudson · Pull Request #84 · ardevd/jlrpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Platform independence + changes to incorporate new dict in vehiclestatus #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2020
Merged
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
7 changes: 4 additions & 3 deletions examples/charge_offpeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This script will check the charging level once every minute
if the vehicle is at home (100 meters or less from the location
specified in the config file) and if the current battery level
specified in the config file) and if the current battery level
meets or exceeds the specified maximum value, the charging will
stop if the vehicle is currently charging.

Expand Down Expand Up @@ -86,7 +86,8 @@ def check_soc():

# getting health status forces a status update
healthstatus = v.get_health_status()
status = { d['key'] : d['value'] for d in v.get_status()['vehicleStatus'] }
vehicleStatus = v.get_status()['vehicleStatus']
status = { d['key'] : d['value'] for d in vehicleStatus['evStatus'] }

current_soc = int(status['EV_STATE_OF_CHARGE'])
charging_status = status['EV_CHARGING_STATUS']
Expand All @@ -112,7 +113,7 @@ def check_soc():
logger.info("car is not plugged in")

config = configparser.ConfigParser()
configfile = os.environ['HOME']+"/.jlrpy.ini"
configfile = (os.path.expanduser('~')+"/.jlrpy.ini") #make platform independent
config.read(configfile)
username = config['jlrpy']['email']
password = config['jlrpy']['password']
Expand Down
0