Bläddra i källkod

Ansible adaptions

master
Dirk Alders 1 år sedan
förälder
incheckning
9a58155e00
4 ändrade filer med 43 tillägg och 5 borttagningar
  1. 16
    0
      .vscode/launch.json
  2. 14
    0
      .vscode/settings.json
  3. 5
    5
      config_example/config.py
  4. 8
    0
      init_venv

+ 16
- 0
.vscode/launch.json Visa fil

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

+ 14
- 0
.vscode/settings.json Visa fil

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

+ 5
- 5
config_example/config.py Visa fil

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

+ 8
- 0
init_venv Visa fil

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

Laddar…
Avbryt
Spara