Thank you, working perfectly now.
You are all amazingly helpful. Couldn't have solved this so quickly without all your help.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Thank you, working perfectly now.
You are all amazingly helpful. Couldn't have solved this so quickly without all your help.
Right, I've figured where the KM value is & I've added a new line of code which takes the KM and divides by 1.6 which should give me a rough mileage conversion.
Just need to figure out how to round it up neatly now.
result = requests.get(url, headers=headers).json()
convert = ({result['remaining_range']/1.6})
if result['charging']:
minutes = result['remaining_time']
remaining = fuzzy_duration(minutes)
status = f"done charging in {remaining}"
else:
status = "is not charging"
return f"{carname} can go {convert} miles. Battery is {result['charge_level']}% full and {status}."
I notice there is a programming tool called 'round', but I can't seem to get it to work.
I tried convert = round ({result['remaining_range']/1.6})
Ah !!! ... Thank you so very much.
I didn't even see the + sign. Doh !!!
It's working now, so all I have to do is alter the code to display miles instead of km.
This should be fairly simple (i hope).
That instruction is in there at the bottom of the script, but it only actions 'if shortcuts.is_shortcut():'
I'm totally new to this, so don't really know what it is looking for to make the statement true.
I've recently bought myself a lovely Zoe R110 ZE40 electric car, and stumbled across this on the web.
https://adrian.schoenig.me/blog/2019/01/20/hey-siri-preheat-my-car/
I really liked the idea of having Siri tell me the status of my car, so bought & downloaded Pythonista 3 to my iPhone X and then shifted over to the beta so that I could use shortcuts.
I have very little programming knowledge, but have the script running on my iPhone just fine. The thing is I am struggling with the shortcut, as when I tap on the shortcut I created it just open Pythonista and then a text displays the results.
Anyone know how too make Siri say the results please?