File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,13 @@ def get_exported(self) -> float:
30
30
return self .client .read_input_registers (0x0004 , ModbusDataType .UINT_32 , unit = self .id ) * 10
31
31
32
32
def get_power_factors (self ) -> List [float ]:
33
- # Faktorisierung anders als in der Dokumentation angegeben
34
- return [val / 10 for val in self .client .read_input_registers (
33
+ # Faktorisierung anders als in der Dokumentation angegeben?
34
+ factors = [val / 10 for val in self .client .read_input_registers (
35
35
0x20 , [ModbusDataType .UINT_32 ]* 3 , unit = self .id )]
36
+ # check if the absolute value of an entry in factors is greater 1
37
+ if any ([abs (factor ) > 1 for factor in factors ]):
38
+ factors = [factor / 100 for factor in factors ]
39
+ return factors
36
40
37
41
def get_frequency (self ) -> float :
38
42
return self .client .read_input_registers (0x2c , ModbusDataType .UINT_32 , unit = self .id ) / 100
You can’t perform that action at this time.
0 commit comments