Ansible adaptions

This commit is contained in:
Dirk Alders 2023-11-03 17:31:07 +01:00
parent 944824d502
commit 9a58155e00
4 changed files with 43 additions and 5 deletions

16
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Main File execution",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/powerplug.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
}

14
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"autopep8.args": ["--max-line-length=150"],
"[python]": {
"python.formatting.provider": "none",
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true
},
"editor.fontSize": 14,
"emmet.includeLanguages": { "django-html": "html" },
"python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}

View File

@ -3,10 +3,10 @@
import os import os
import report import report
MQTT_USER = "user" QTT_USER = "<mqtt_smarthome_username>"
MQTT_PASS = "pass" MQTT_PASS = "<mqtt_smarthome_password>"
MQTT_SERVER = "localhost" MQTT_SERVER = "<mqtt_smarthome_hostname>"
MQTT_TOPIC = "dirk/powerplug" MQTT_TOPIC = "<mqtt_powerplug_topic>"
# #
# Logging # Logging
@ -14,7 +14,7 @@ MQTT_TOPIC = "dirk/powerplug"
__BASEPATH__ = os.path.abspath(os.path.dirname(__file__)) __BASEPATH__ = os.path.abspath(os.path.dirname(__file__))
APP_NAME = "powerplug" APP_NAME = "powerplug"
LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout' LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout'
LOGLVL = 'DEBUG' LOGLVL = 'INFO'
LOGHOST = 'cutelog' LOGHOST = 'cutelog'
LOGPORT = 19996 LOGPORT = 19996

8
init_venv Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#
BASEPATH=`realpath $(dirname $0)`
python3 -m venv $BASEPATH/venv
$BASEPATH/venv/bin/pip install --upgrade pip
find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r
$BASEPATH/venv/bin/pip list --outdated --format=json | jq -r '.[] | .name'|xargs -n1 $BASEPATH/venv/bin/pip install -U