Skip to content
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

Loop #67

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open

Loop #67

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
64e908f
JSONDecodeError appears
martinst06 Apr 5, 2024
e263c65
combine both the functions and it works now
martinst06 Apr 5, 2024
5a2a8cf
Error has been fixed. Gets data every 10s to mc
martinst06 Apr 8, 2024
6333cb9
Everything is working. Pre-testing TSDB
martinst06 Apr 22, 2024
f0d9110
Writing to TSDB fully works. Details left for FG
martinst06 Apr 22, 2024
5788193
dev and prod - loop for handling rules
martinst06 May 17, 2024
674aa00
Added rules handling
martinst06 May 17, 2024
c214acf
Added port and baudrates to .env
martinst06 May 17, 2024
f029caa
dev and prod + started with classes
martinstoo Jun 6, 2024
5e0cc8b
Accessors defined and work as intended
martinstoo Jun 7, 2024
32a2209
fixed DB not connecting + small changes
martinstoo Jun 7, 2024
f641155
waterChecker checks if the values are within range
martinstoo Jun 7, 2024
2ecced9
feat: add cronjob with logger at debug level, refactor: renamed class…
martinstoo Jun 10, 2024
776913c
test
martinstoo Jun 10, 2024
1ef24a4
feat: schedule / cronjobs
martinst06 Jun 10, 2024
0b438dd
refactor: renamed function + moved to suitable class
martinst06 Jun 10, 2024
1f47977
chore: removed __pycache__
martinst06 Jun 10, 2024
c152338
refactor: renamed classes, functions and variables + removed unnecess…
martinst06 Jun 10, 2024
c32b4a8
chore: moved loop related files to a folder + removed old rules file
martinst06 Jun 10, 2024
a80a762
refactor: moved scheduling from rule to service + renamed functions +…
martinst06 Jun 10, 2024
9e0930a
feat: can properly run inRange function now, probably will be changed…
martinst06 Jun 10, 2024
82ccc48
refactor: moved inRange function from rule.py to service.py
martinst06 Jun 13, 2024
303ebd1
feat: added sensor class
martinst06 Jun 13, 2024
40227df
chore: removed no longer needed code, finished comment on inRange fun…
martinst06 Jun 13, 2024
032099f
style: changed naming convention to: camelCase
martinst06 Jun 13, 2024
035d127
style: changed naming convention to: camelCase
martinst06 Jun 13, 2024
66c43db
chore: updated path
martinst06 Jun 13, 2024
380002d
refactor: renaming variables, removing empty spaces etc.
martinst06 Jun 24, 2024
c7c5c75
fix: scheduleService now executes an action at the scheduled time (wi…
martinst06 Jun 24, 2024
e521667
fix: added missing value 'zoneID'
martinst06 Jun 24, 2024
5368048
fix: fixed influxdb not working after adding zoneID
martinst06 Jun 28, 2024
105cad2
chore: reordered zoneID to be 3rd in the fake json, that way everythi…
martinst06 Jun 28, 2024
bfdc80c
docs: document functions
martinst06 Jun 28, 2024
8ec1d9f
fix: valve rounds to whole number but is still a float
martinst06 Jun 28, 2024
cda9397
feat: current data is being fetched in 'real time'
martinst06 Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 153 additions & 118 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,165 @@
# Logs
logs
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Next.js build output
.next
out
# Spyder project settings
.spyderproject
.spyproject

# Nuxt.js build / generate output
.nuxt
dist
# Rope project settings
.ropeproject

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache
# mkdocs documentation
/site

# Docusaurus cache and generated files
.docusaurus
# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Serverless directories
.serverless/
# Pyre type checker
.pyre/

# FuseBox cache
.fusebox/
# pytype static type analyzer
.pytype/

# DynamoDB Local files
.dynamodb/
# Cython debug symbols
cython_debug/

# TernJS port file
.tern-port
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
dev/loop/pids.txt
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# awmps
## Dev Manuelle Einleitung

First Change: Hello my name Is Triistan!
1. Geben Sie der Datei start.sh Ausführungsrechte:
- `chmod +x start.sh`

2. Führen Sie **_start.sh_** aus
- `./start.sh`
50 changes: 50 additions & 0 deletions dev/http/rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"createdAt" : "01-03-2024",
"rulesID" : 1,
"potID" : 2,
"zoneID" : 3,
"duration" : 5,
"action" : "water",
"schedule" : "*/1 * * * *",
"enabled" : true,
"rainProbabilityMin" : 0,
"rainProbabilityMax" : 40,
"humidityMin" : 25,
"humidityMax" : 40,
"luxMin" : 180,
"luxMax" : 250
},
{
"createdAt" : "01-04-2024",
"rulesID" : 4,
"potID" : 5,
"zoneID" : 1,
"duration" : 30,
"action" : "water",
"schedule" : "*/1 * * * *",
"enabled" : true,
"rainProbabilityMin" : 5,
"rainProbabilityMax" : 25,
"humidityMin" : 20,
"humidityMax" : 40,
"luxMin" : 150,
"luxMax" : 240
},
{
"createdAt" : "04-05-2024",
"rulesID" : 2,
"potID" : 3,
"zoneID" : 3,
"duration" : 10,
"action" : "water",
"schedule" : "*/1 * * * *",
"enabled" : true,
"rainProbabilityMin" : 10,
"rainProbabilityMax" : 30,
"humidityMin" : 15,
"humidityMax" : 30,
"luxMin" : 120,
"luxMax" : 200
}
]
Loading