From 08f963b352b280272adf80a8225314aad4bfbe55 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 12:30:17 +0100 Subject: [PATCH 1/6] Create black.yml --- .github/workflows/black.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..b04fb15 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,10 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: psf/black@stable From 0987ce34bcadeab0a8fb3637ef96801c2b38d4c3 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 14:37:14 +0100 Subject: [PATCH 2/6] Create Makefile --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7585dc6 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +DEVICE = /dev/ttyUSB0 +DEVICENAME = ? +IMAGE = images/esp32c3-20220618-v1.19.1.bin + +default: help + +image:. ## Flash Micropython firmware + esptool.py --port ${DEVICE} erase_flash + esptool.py --chip esp32c3 --port ${DEVICE} --baud 460800 write_flash -z 0x0 ${IMAGE} + +code:. ## Flash programm + ampy put src/lib/wifi.py wifi.py + ampy put src/lib/mqtt.py mqtt.py + ampy put src/lib/mytrix.py mytrix.py + ampy put config/config_base.json config_base.json + ampy put config/config_${DEVICENAME}.json config_device.json + ampy put src/main.py main.py + ampy reset + +help: ## Show this help + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' From a2a286d20ae48f1fb9861bb9862801acfaec3032 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 15:27:38 +0100 Subject: [PATCH 3/6] Create pyproject.toml --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2a16827 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[tool.black] +line-length = 114 +target-version = ['py310'] +include = '\.pyi?$' From a9f520da8cedde3b6a16a40e6619729187039895 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 15:29:51 +0100 Subject: [PATCH 4/6] Create .editorconfig --- .editorconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5aa387d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +[*.py] +charset = utf-8 +indent_style = space +indent_size = 4 + +[Makefile] +indent_style = tab From ad1f810cb21f583c8da03b24cf71a339d05e2a53 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 15:31:30 +0100 Subject: [PATCH 5/6] Update .gitignore --- .gitignore | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/.gitignore b/.gitignore index b2409e3..d482441 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,124 @@ +# configuration files config/* !config/*.template + + +# Created by https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim +# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm+all,circuitpython,vim + +### CircuitPython ### +.Trashes +.metadata_never_index +.fseventsd/ +boot_out.txt + +### PyCharm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# End of https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim From 726b43da22a15ab81a572a986311307f364bc6c8 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Wed, 22 Feb 2023 15:32:57 +0100 Subject: [PATCH 6/6] Update .gitignore --- .gitignore | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d482441..f2890d0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,41 @@ config/* !config/*.template -# Created by https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim -# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm+all,circuitpython,vim +# Created by https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm+all,circuitpython,vim,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud ### CircuitPython ### .Trashes @@ -121,4 +154,4 @@ tags # Persistent undo [._]*.un~ -# End of https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim +# End of https://www.toptal.com/developers/gitignore/api/pycharm+all,circuitpython,vim,macos