-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestApi.py
More file actions
33 lines (26 loc) · 896 Bytes
/
TestApi.py
File metadata and controls
33 lines (26 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import configparser
import logging
import math
import threading
import time
from logging.handlers import RotatingFileHandler
import locale
from flask import Flask, request, render_template
from geopy.geocoders import Nominatim
from teslapy import Tesla
#from werkzeug.middleware.proxy_fix import ProxyFix
from power import read_haus_stromverbrauch
from pv import read_pv_voltage
# from flask_reverse_proxy_fix.middleware import ReverseProxyPrefixFix
def main():
print("Hello World!")
tesla = Tesla("norbert.ganslmeier@gmail.com", False, False)
vehicles = tesla.vehicle_list()
vehdata = vehicles[0].get_vehicle_data()
locale.setlocale(locale.LC_ALL, 'de')
print(locale.format_string('%10.0f', 1374 , grouping=True))
while True:
print(vehdata['charge_state']['charge_current_request'])
time.sleep(10)
if __name__ == "__main__":
main()