Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: firstof9/python-openevse-http
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.12
Choose a base ref
...
head repository: firstof9/python-openevse-http
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
10 changes: 5 additions & 5 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -9,19 +9,19 @@ jobs:
name: Builds and publishes releases to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v2.2.2
- uses: actions/checkout@v3.1.0
- name: Set up Python 3.9
uses: actions/setup-python@v4.3.0
with:
python-version: 3.8
python-version: 3.9
- name: Install wheel
run: >-
pip install wheel
- name: Build
run: >-
python3 setup.py sdist bdist_wheel
- name: Publish release to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
26 changes: 16 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# This workflow will install Python dependencies, run tests and lint
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test

on:
push:
branches: [main]
branches:
- main
- dev
pull_request:
branches: [main]
branches:
- main
- dev

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
python-version:
- "3.13"

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@@ -31,7 +35,7 @@ jobs:
- name: Test with tox
run: tox
- name: Upload coverage data
uses: "actions/upload-artifact@v2.2.4"
uses: "actions/upload-artifact@v4"
with:
name: coverage-data
path: "coverage.xml"
@@ -41,12 +45,14 @@ jobs:
needs: build
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Download coverage data
uses: actions/download-artifact@v2.0.10
uses: actions/download-artifact@v4
with:
name: coverage-data
- name: Upload coverage report
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
77 changes: 77 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
args:
- --safe
- --quiet
files: ^(openevsehttp/.+)?[^/]+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v1.17.1
hooks:
- id: codespell
args:
- --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing,iam,incomfort
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
files: ^openevsehttp/.+\.py$
args:
- --max-line-length=500
- --ignore=E203,E266,E501,W503
- --max-complexity=18
- --select=B,C,E,F,W,T4,B9
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
args:
- --multi-line=3
- --trailing-comma
- --force-grid-wrap=0
- --use-parentheses
- --line-width=88
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: no-commit-to-branch
args:
- --branch=main
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.24.2
hooks:
- id: yamllint
- repo: https://github.com/prettier/prettier
rev: 2.0.4
hooks:
- id: prettier
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.930"
hooks:
- id: mypy
files: ^openevsehttp/.+\.py$
60 changes: 60 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
ignore: |
release-drafter.yml
rules:
braces:
level: error
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
level: error
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
level: error
max-spaces-before: 0
max-spaces-after: 1
commas:
level: error
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: error
require-starting-space: true
min-spaces-from-content: 2
comments-indentation:
level: error
document-end:
level: error
present: false
document-start:
level: error
present: false
empty-lines:
level: error
max: 1
max-start: 0
max-end: 1
hyphens:
level: error
max-spaces-after: 1
indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: false
key-duplicates:
level: error
line-length: disable
new-line-at-end-of-file:
level: error
new-lines:
level: error
type: unix
trailing-spaces:
level: error
truthy: disable
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
![Codecov branch](https://img.shields.io/codecov/c/github/firstof9/python-openevse-http/main?style=flat-square)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/firstof9/python-openevse-http?style=flat-square)
![GitHub last commit](https://img.shields.io/github/last-commit/firstof9/python-openevse-http?style=flat-square)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/firstof9/python-openevse-http?style=flat-square)
# python-openevse-http
Python Library for OpenEVSE HTTP API

A python library for communicating with the ESP8266- and ESP32-based wifi module from OpenEVSE. This library uses the HTTP API commands to query the OpenEVSE charger.

TODO:
- [ ] Fix tests
- [ ] Finish tests
- [ ] Finish HTTP API functions
- [X] Setup webosocket listener for value updates
- [X] Convert to aiohttp from requests
Loading