From 4692ec8f6c2c5d57feb9fd3b67624d2cda1a3e54 Mon Sep 17 00:00:00 2001 From: Matt Rayner Date: Mon, 8 Apr 2024 12:13:54 +0100 Subject: [PATCH 1/2] Update README and rev version --- CHANGELOG.md | 1 + podpointclient/version.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 973bfa8..13839d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Add `Pod.offering_energy` - @mattrayner * Add `Pod.last_message_at` - @mattrayner * Add `Pod.charging_state` - @mattrayner +* Add `SUSPENDED_EV` to Pod state Enums - @mattrayner ## v1.5.0 diff --git a/podpointclient/version.py b/podpointclient/version.py index c8944be..92a3818 100644 --- a/podpointclient/version.py +++ b/podpointclient/version.py @@ -1,3 +1,3 @@ """Version for the podpointclient library""" -__version__ = "1.6.0a4" +__version__ = "1.6.0" From b18bbc12447cc233fd771c5aaffe78a00a7b6160 Mon Sep 17 00:00:00 2001 From: Matt Rayner Date: Mon, 8 Apr 2024 14:13:20 +0100 Subject: [PATCH 2/2] Update README and example --- README.md | 7 +++++++ example.py | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30461ed..4c586ff 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,13 @@ Method | Description `async_get_charges(perpage=5, page=2)` | *Get charges for a user* - Returns a list of `Charge` objects. `perpage` can be 'all', or a number. Can get additional pages with `page` attribute. `async_get_firmware(pod=_Pod_)` | *Get firmware information for a pod* - Returns a list of `Firmware` objects. `async_get_user(includes=[])` | *Get current user account information* - Returns a `User` object including account balance, units and vehicles. `includes` is a list of additional information pulled for a User. Pass an empty list to `includes` for minimal information or `None` for full data (defaults to `None`) +`async_get_charge_override(pod=_Pod_)` | *Get the current charge override for a pod* - Returns a `ChargeOverride` object. +`async_set_charge_override(pod=_Pod_, enabled=False, start_time=None, end_time=None)` | *Set a charge override for a pod* - Returns a `ChargeOverride` object. +`async_delete_charge_override(pod=_Pod_)` | *Delete a charge override for a pod* - Returns a boolean. +`async_set_charge_mode_manual(pod=_Pod_)` | *Set a pod to manual charge mode* - Returns a `Pod` object. +`async_set_charge_mode_smart(pod=_Pod_)` | *Set a pod to smart charge mode* - Returns a `Pod` object. +`async_get_charge_mode(pod=_Pod_)` | *Get the current charge mode for a pod* - Returns a `ChargeMode` object. +`async_get_connection_status(pod=_Pod_)` | *Get the current connection status for a pod* - Returns a `ConnectionStatus` object. ### Example diff --git a/example.py b/example.py index f3b8053..099088d 100644 --- a/example.py +++ b/example.py @@ -68,6 +68,11 @@ async def main(username: str, password: str, http_debug: bool = False, loop=None override = await client.async_set_charge_override(pod=pod, hours=1) print(f" Override until: {override.ends_at}") + # Get charge override + print(f"Attempting to get charge override for pod {pod.ppid}") + override = await client.async_get_charge_override(pod=pod) + print(f" Override ends at: {override.ends_at}") + # Delete override print(f"Deleting 'Charge now' for pod {pod.ppid}") await client.async_delete_charge_override(pod=pod) @@ -76,7 +81,8 @@ async def main(username: str, password: str, http_debug: bool = False, loop=None # Get charge override print(f"Attempting to get charge override for pod {pod.ppid}") override = await client.async_get_charge_override(pod=pod) - print(f" Override ends at: {override.ends_at}") + print(f" Override removed: {override is None}") + # Get connectivity status print(f"Getting connectivity status for pod {pod.ppid}")