#!/usr/bin/env python3 from wallbox import Wallbox, Statuses import time import datetime w = Wallbox("login de l'API", "Mot de passe") # Authenticate with the credentials above w.authenticate() # Print a list of chargers in the account print(w.getChargersList()) # Get charger data for all chargers in the list, then lock and unlock chargers for chargerId in w.getChargersList(): chargerStatus = w.getChargerStatus(chargerId) print(f"Charger Status: {chargerStatus}") print(f"Lock Charger ") w.lockCharger(chargerId) time.sleep(10) chargerStatus = w.getChargerStatus(chargerId) print(f"Status lock {chargerStatus['config_data']['locked']}") print(f"Unlock Charger ") w.unlockCharger(chargerId) time.sleep(10) chargerStatus = w.getChargerStatus(chargerId) print(f"Status lock {chargerStatus['config_data']['locked']}") # Print the status the charger is currently in using the status id print(f"Charger Mode: {Statuses(chargerStatus['status_id']).name}")