-
Notifications
You must be signed in to change notification settings - Fork 8
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
example for how to use subscribe_for_vehicle_updates #93
Comments
Your statements are somewhat contradictory. Polling and subscribing are two different approaches for receiving the data. You can use them in combination with each other, but the If you want to poll every 30 seconds, do something like: while True:
response = await api.get_vehicle_state(vehicle_id)
await asyncio.sleep(30) If you want to receive data by subscribing, you can do something like: def handle_update(updated_data: dict) -> None:
# do something with the updated data
logging.debug("%s", updated_data)
await api.subscribe_for_vehicle_updates(vehicle_id, callback=handle_update) |
ah...got it thanks! I will give it a try, is it possible to get live charging data from subscribe? |
Live charging data over the subscription? Meaning what specifically? Charge rate and such from the onboard vehicle based charger, yeah. Though not for say your wall box unfortunately we haven't been able to find evidence of that information over a subscription. |
@tmack8001 is it possible to make call back function a async function? |
i want to use websocket to get state of the vehicle, but i just can't make it work
can you provide me a short example how to get vehicle state something like every 30 seconds? with web socket using subscribe_for_vehicle_updates?
The text was updated successfully, but these errors were encountered: