瀏覽代碼

Smartplug Encoded: identified unknown values.

These are random, "circulate" (repeating pattern?), and schedule
respectively.  Content is a base64 encoded binary structure which we
still haven't decoded, so the names are informational only, but may
assist with identifying the contents.
Jason Rumney 3 年之前
父節點
當前提交
9b46e5962f
共有 3 個文件被更改,包括 13 次插入13 次删除
  1. 1 1
      README.md
  2. 3 3
      custom_components/tuya_local/devices/smartplug_encoded.yaml
  3. 9 9
      tests/devices/test_smartplug_encoded.py

+ 1 - 1
README.md

@@ -159,6 +159,7 @@ If you submit a pull request, please understand that the config file naming and
 
 ### Kitchen Appliances
 - Kogan Glass 1.7L Smart Kettle (not reliably detected)
+- Inkbird Sous Vide Cooker
 
 ### Smart Meter/Circuit Breaker
 - SmartMCB SMT006 Energy Meter
@@ -220,7 +221,6 @@ Other brands may work with the above configurations
 - Universal Remote Control (supports sensors only)
 - Catit Pixi Smart Fountain
 - Bresser Smart 7-in-1 Weather Station
-- Inkbird Sous Vide Cooker
 
 ---
 

+ 3 - 3
custom_components/tuya_local/devices/smartplug_encoded.yaml

@@ -11,15 +11,15 @@ primary_entity:
       name: switch
     - id: 101
       type: base64
-      name: unknown_101
+      name: random
       readonly: true
     - id: 102
       type: base64
-      name: unknown_102
+      name: circulate
       readonly: true
     - id: 103
       type: base64
-      name: unknown_103
+      name: schedule
       readonly: true
 secondary_entities:
   - entity: number

+ 9 - 9
tests/devices/test_smartplug_encoded.py

@@ -11,9 +11,9 @@ from .base_device_tests import TuyaDeviceTestCase
 
 SWITCH_DPS = "1"
 TIMER_DPS = "11"
-UNKNOWN101_DPS = "101"
-UNKNOWN102_DPS = "102"
-UNKNOWN103_DPS = "103"
+RANDOM_DPS = "101"
+CIRCULATE_DPS = "102"
+SCHEDULE_DPS = "103"
 
 
 class TestSwitchEncoded(BasicNumberTests, SwitchableTests, TuyaDeviceTestCase):
@@ -36,14 +36,14 @@ class TestSwitchEncoded(BasicNumberTests, SwitchableTests, TuyaDeviceTestCase):
         self.assertEqual(self.subject.device_class, SwitchDeviceClass.OUTLET)
 
     def test_extra_state_attributes_set(self):
-        self.dps[UNKNOWN101_DPS] = "101"
-        self.dps[UNKNOWN102_DPS] = "102"
-        self.dps[UNKNOWN103_DPS] = "103"
+        self.dps[RANDOM_DPS] = "101"
+        self.dps[CIRCULATE_DPS] = "102"
+        self.dps[SCHEDULE_DPS] = "103"
         self.assertDictEqual(
             self.subject.extra_state_attributes,
             {
-                "unknown_101": "101",
-                "unknown_102": "102",
-                "unknown_103": "103",
+                "random": "101",
+                "circulate": "102",
+                "schedule": "103",
             },
         )