Explorar el Código

fix (powerworld_pw58410): extract temperatures as signed integers

Some of these temperatures are unlikely to go negative, but there are
sufficient bits that that there should not be any issues with signed
overflow at the other end, so just make all temperatures signed.

Issue #4268
Jason Rumney hace 5 meses
padre
commit
cbddda546f

+ 10 - 0
custom_components/tuya_local/devices/powerworld_pw58410_hvaconly.yaml

@@ -100,6 +100,7 @@ entities:
                00000000FFFFFFFF00000000000000000000000000000000\
                00000000FFFFFFFF00000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 118
       - id: 118
         type: string
         type: string
         optional: true
         optional: true
@@ -206,6 +207,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -226,6 +228,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -246,6 +249,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -266,6 +270,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -286,6 +291,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -306,6 +312,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -326,6 +333,7 @@ entities:
                FFFFFFFF0000000000000000000000000000000000000000\
                FFFFFFFF0000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -384,6 +392,7 @@ entities:
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000000000000000000000000000FFFFFFFF\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -471,6 +480,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit

+ 10 - 0
custom_components/tuya_local/devices/powerworld_pw58410_waterheater.yaml

@@ -36,6 +36,7 @@ entities:
                00000000FFFFFFFF00000000000000000000000000000000\
                00000000FFFFFFFF00000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 118
       - id: 118
         type: string
         type: string
         optional: true
         optional: true
@@ -197,6 +198,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -217,6 +219,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -237,6 +240,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -257,6 +261,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -277,6 +282,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -297,6 +303,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -317,6 +324,7 @@ entities:
                FFFFFFFF0000000000000000000000000000000000000000\
                FFFFFFFF0000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -375,6 +383,7 @@ entities:
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000000000000000000000000000FFFFFFFF\
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit
@@ -462,6 +471,7 @@ entities:
                000000000000000000000000000000000000000000000000\
                000000000000000000000000000000000000000000000000\
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000000000000000000000000000FFFFFFFF\
                0000000000000000"
                0000000000000000"
+        mask_signed: true
       - id: 6
       - id: 6
         type: string
         type: string
         name: unit
         name: unit