Bläddra i källkod

Add TDS to YINMIK

Mark Roberts 1 år sedan
förälder
incheckning
e401d56f43

+ 4 - 1
.vscode/settings.json

@@ -4,7 +4,7 @@
   "editor.formatOnType": true,
   "files.eol": "\n",
   "files.trimTrailingWhitespace": true,
-  "files.insertFinalNewline": true,  
+  "files.insertFinalNewline": true,
   "python.linting.pylintEnabled": true,
   "python.linting.enabled": true,
   "python.formatting.provider": "black",
@@ -12,4 +12,7 @@
   "python.testing.pytestEnabled": true,
   "pylint.importStrategy": "fromEnvironment",
   "python.linting.lintOnSave": true,
+  "files.associations": {
+    "*.yaml": "home-assistant"
+  },
 }

+ 14 - 0
custom_components/tuya_local/devices/yinmik_waterquality_tester.yaml

@@ -15,6 +15,20 @@ primary_entity:
       mapping:
         - scale: 10
 secondary_entities:
+  - entity: sensor
+    name: Total dissolved solids
+    icon: "mdi:water-opacity"
+    dps:
+      - id: 1
+        type: integer
+        name: sensor
+        class: measurement
+        unit: ppm
+        optional: true
+        mapping:
+          - range:
+            min: 0
+            max: 1000
   - entity: sensor
     class: battery
     category: diagnostic