|
29 | 29 | UnitOfPower, |
30 | 30 | UnitOfPressure, |
31 | 31 | UnitOfReactiveEnergy, |
| 32 | + UnitOfReactivePower, |
32 | 33 | UnitOfSpeed, |
33 | 34 | UnitOfTemperature, |
34 | 35 | UnitOfTime, |
|
57 | 58 | PowerConverter, |
58 | 59 | PressureConverter, |
59 | 60 | ReactiveEnergyConverter, |
| 61 | + ReactivePowerConverter, |
60 | 62 | SpeedConverter, |
61 | 63 | TemperatureConverter, |
62 | 64 | UnitlessRatioConverter, |
|
89 | 91 | PowerConverter, |
90 | 92 | PressureConverter, |
91 | 93 | ReactiveEnergyConverter, |
| 94 | + ReactivePowerConverter, |
92 | 95 | SpeedConverter, |
93 | 96 | TemperatureConverter, |
94 | 97 | UnitlessRatioConverter, |
|
100 | 103 |
|
101 | 104 | # Dict containing all converters with a corresponding unit ratio. |
102 | 105 | _GET_UNIT_RATIO: dict[type[BaseUnitConverter], tuple[str | None, str | None, float]] = { |
| 106 | + ApparentPowerConverter: ( |
| 107 | + UnitOfApparentPower.MILLIVOLT_AMPERE, |
| 108 | + UnitOfApparentPower.VOLT_AMPERE, |
| 109 | + 1000, |
| 110 | + ), |
103 | 111 | AreaConverter: (UnitOfArea.SQUARE_KILOMETERS, UnitOfArea.SQUARE_METERS, 0.000001), |
104 | 112 | BloodGlucoseConcentrationConverter: ( |
105 | 113 | UnitOfBloodGlucoseConcentration.MILLIGRAMS_PER_DECILITER, |
|
141 | 149 | CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER, |
142 | 150 | 1000, |
143 | 151 | ), |
144 | | - ApparentPowerConverter: ( |
145 | | - UnitOfApparentPower.MILLIVOLT_AMPERE, |
146 | | - UnitOfApparentPower.VOLT_AMPERE, |
147 | | - 1000, |
148 | | - ), |
149 | 152 | PowerConverter: (UnitOfPower.WATT, UnitOfPower.KILO_WATT, 1000), |
150 | 153 | PressureConverter: (UnitOfPressure.HPA, UnitOfPressure.INHG, 33.86389), |
151 | 154 | ReactiveEnergyConverter: ( |
152 | 155 | UnitOfReactiveEnergy.VOLT_AMPERE_REACTIVE_HOUR, |
153 | 156 | UnitOfReactiveEnergy.KILO_VOLT_AMPERE_REACTIVE_HOUR, |
154 | 157 | 1000, |
155 | 158 | ), |
| 159 | + ReactivePowerConverter: ( |
| 160 | + UnitOfReactivePower.MILLIVOLT_AMPERE_REACTIVE, |
| 161 | + UnitOfReactivePower.VOLT_AMPERE_REACTIVE, |
| 162 | + 1000, |
| 163 | + ), |
156 | 164 | SpeedConverter: ( |
157 | 165 | UnitOfSpeed.KILOMETERS_PER_HOUR, |
158 | 166 | UnitOfSpeed.MILES_PER_HOUR, |
|
176 | 184 | _CONVERTED_VALUE: dict[ |
177 | 185 | type[BaseUnitConverter], list[tuple[float, str | None, float, str | None]] |
178 | 186 | ] = { |
| 187 | + ApparentPowerConverter: [ |
| 188 | + ( |
| 189 | + 10, |
| 190 | + UnitOfApparentPower.MILLIVOLT_AMPERE, |
| 191 | + 0.01, |
| 192 | + UnitOfApparentPower.VOLT_AMPERE, |
| 193 | + ), |
| 194 | + ], |
179 | 195 | AreaConverter: [ |
180 | 196 | # Square Meters to other units |
181 | 197 | (5, UnitOfArea.SQUARE_METERS, 50000, UnitOfArea.SQUARE_CENTIMETERS), |
|
623 | 639 | (1, UnitOfMass.STONES, 14, UnitOfMass.POUNDS), |
624 | 640 | (1, UnitOfMass.STONES, 224, UnitOfMass.OUNCES), |
625 | 641 | ], |
626 | | - ApparentPowerConverter: [ |
627 | | - ( |
628 | | - 10, |
629 | | - UnitOfApparentPower.MILLIVOLT_AMPERE, |
630 | | - 0.01, |
631 | | - UnitOfApparentPower.VOLT_AMPERE, |
632 | | - ), |
633 | | - ], |
634 | 642 | PowerConverter: [ |
635 | 643 | (10, UnitOfPower.KILO_WATT, 10000, UnitOfPower.WATT), |
636 | 644 | (10, UnitOfPower.MEGA_WATT, 10e6, UnitOfPower.WATT), |
|
682 | 690 | UnitOfReactiveEnergy.KILO_VOLT_AMPERE_REACTIVE_HOUR, |
683 | 691 | ), |
684 | 692 | ], |
| 693 | + ReactivePowerConverter: [ |
| 694 | + ( |
| 695 | + 10, |
| 696 | + UnitOfReactivePower.KILO_VOLT_AMPERE_REACTIVE, |
| 697 | + 10000, |
| 698 | + UnitOfReactivePower.VOLT_AMPERE_REACTIVE, |
| 699 | + ), |
| 700 | + ( |
| 701 | + 10, |
| 702 | + UnitOfReactivePower.VOLT_AMPERE_REACTIVE, |
| 703 | + 0.01, |
| 704 | + UnitOfReactivePower.KILO_VOLT_AMPERE_REACTIVE, |
| 705 | + ), |
| 706 | + ( |
| 707 | + 10, |
| 708 | + UnitOfReactivePower.MILLIVOLT_AMPERE_REACTIVE, |
| 709 | + 0.01, |
| 710 | + UnitOfReactivePower.VOLT_AMPERE_REACTIVE, |
| 711 | + ), |
| 712 | + ( |
| 713 | + 10, |
| 714 | + UnitOfReactivePower.MILLIVOLT_AMPERE_REACTIVE, |
| 715 | + 0.00001, |
| 716 | + UnitOfReactivePower.KILO_VOLT_AMPERE_REACTIVE, |
| 717 | + ), |
| 718 | + ], |
685 | 719 | SpeedConverter: [ |
686 | 720 | # 5 km/h / 1.609 km/mi = 3.10686 mi/h |
687 | 721 | (5, UnitOfSpeed.KILOMETERS_PER_HOUR, 3.106856, UnitOfSpeed.MILES_PER_HOUR), |
|
0 commit comments