mirror of
				https://github.com/XiaoMi/ha_xiaomi_home.git
				synced 2025-11-04 19:32:07 +08:00 
			
		
		
		
	fix: cuco.plug.cp2 voltage and power value ratio
This commit is contained in:
		@@ -121,3 +121,11 @@ urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3:
 | 
				
			|||||||
    expr: round(src_value*6/1000000, 3)
 | 
					    expr: round(src_value*6/1000000, 3)
 | 
				
			||||||
urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:1: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3
 | 
					urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:1: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3
 | 
				
			||||||
urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:2: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3
 | 
					urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:2: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3
 | 
				
			||||||
 | 
					urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2:
 | 
				
			||||||
 | 
					  prop.2.3:
 | 
				
			||||||
 | 
					    expr: round(src_value/10, 1)
 | 
				
			||||||
 | 
					  prop.2.4:
 | 
				
			||||||
 | 
					    unit: mA
 | 
				
			||||||
 | 
					  prop.3.2:
 | 
				
			||||||
 | 
					    expr: round(src_value/10, 1)
 | 
				
			||||||
 | 
					urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:1: urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2
 | 
				
			||||||
@@ -110,7 +110,7 @@ class Sensor(MIoTPropertyEntity, SensorEntity):
 | 
				
			|||||||
                self._attr_native_unit_of_measurement = list(
 | 
					                self._attr_native_unit_of_measurement = list(
 | 
				
			||||||
                    unit_sets)[0] if unit_sets else None
 | 
					                    unit_sets)[0] if unit_sets else None
 | 
				
			||||||
            # Set suggested precision
 | 
					            # Set suggested precision
 | 
				
			||||||
            if spec.format_ in {int, float}:
 | 
					            if spec.format_ in {int, float} and spec.expr is None:
 | 
				
			||||||
                self._attr_suggested_display_precision = spec.precision
 | 
					                self._attr_suggested_display_precision = spec.precision
 | 
				
			||||||
            # Set state_class
 | 
					            # Set state_class
 | 
				
			||||||
            if spec.state_class:
 | 
					            if spec.state_class:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user