Skip to content

0xf-group/pyPeblar

Repository files navigation

pyPeblar

General

This document contains the specification of the WLAC local REST API. This API for local networks is supported by Peblar products from firmware versions 1.6 and onwards. Before the API can be accessed, it is required to be enabled in the advanced settings page of the chargers web interface. The endpoints described below can be reached via http://\<local_ip\>/api/wlac/v1/\<endpoint_name\> for example http://10.11.12.13/api/wlac/v1/evinterface.

<img src="./images/api_enable.png"/>

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0.0
  • Generator version: 7.10.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import pyPeblar

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pyPeblar

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import pyPeblar
from pyPeblar.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = pyPeblar.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiToken
configuration.api_key['ApiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'


# Enter a context with an instance of the API client
async with pyPeblar.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyPeblar.EVInterfaceApi(api_client)

    try:
        # Get EV interface information
        api_response = await api_instance.evinterface_get()
        print("The response of EVInterfaceApi->evinterface_get:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling EVInterfaceApi->evinterface_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
EVInterfaceApi evinterface_get GET /evinterface Get EV interface information
EVinterfaceApi evinterface_patch PATCH /evinterface Update EV interface fields
HealthApi health_get GET /health Generic API information
MeterApi meter_get GET /meter Get meter information
SystemApi system_get GET /system Generic system information

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

About

Async Python 3 library for Peblar EV Chargers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published