initial commit

This commit is contained in:
2024-10-14 16:41:24 +02:00
parent 7f0c94dc26
commit 1957d735bc
4 changed files with 165 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import time
import pprint
from we_connect import wci
from credentials import user, password
from we_connect.domains import Domain
def main():
w = wci.WeConnectId(user, password)
vehicles = w.get('/vehicles')
print('list of vehicles:')
for key in vehicles:
print(key)
pprint.pprint(vehicles)
domains = [Domain.ALL_CAPABLE]
endpoint = '/vehicles/' + vehicles['data'][0]['vin'] + '/selectivestatus?jobs='
count = len(domains)
for domain in domains:
endpoint += domain.value
count -= 1
if count > 0:
endpoint += ','
# endpoint = '/vehicles/' + vehicles['data'][0]['vin'] + f'/selectivestatus?jobs=access,charging,climatisation,climatisationTimers,fuelStatus,userCapabilities,vehicleLights,vehicleHealthInspection,oilLevel,measurements'
print(f'Endpoint: {endpoint}')
while True:
start = time.time()
try:
data = w.get(endpoint)
print(data)
except Exception:
pass
stop = time.time()
diff = stop - start
time.sleep(60-diff)
if __name__ == '__main__':
main()