@@ -26,6 +26,9 @@ def __mul__(self, other: float) -> EnergyAmount:
26
26
def __lt__ (self , other : EnergyAmount ) -> bool :
27
27
return self .watt_hours < other .watt_hours
28
28
29
+ def __le__ (self , other : EnergyAmount ) -> bool :
30
+ return self .watt_hours <= other .watt_hours
31
+
29
32
def __gt__ (self , other : EnergyAmount ) -> bool :
30
33
return self .watt_hours > other .watt_hours
31
34
@@ -72,9 +75,15 @@ def __repr__(self):
72
75
def __lt__ (self , other : EnergyRate ) -> bool :
73
76
return self .rate < other .rate
74
77
78
+ def __le__ (self , other : EnergyRate ) -> bool :
79
+ return self .rate <= other .rate
80
+
75
81
def __gt__ (self , other : EnergyRate ) -> bool :
76
82
return self .rate > other .rate
77
83
84
+ def __ge__ (self , other : EnergyRate ) -> bool :
85
+ return self .rate >= other .rate
86
+
78
87
79
88
soc_logger = LoggerMixin ("StateOfCharge" )
80
89
battery_capacity = EnergyAmount (int (EnvironmentVariableGetter .get ("INVERTER_BATTERY_CAPACITY" )))
@@ -105,6 +114,9 @@ def __sub__(self, other: StateOfCharge) -> StateOfCharge:
105
114
def __lt__ (self , other : StateOfCharge ) -> bool :
106
115
return self .absolute < other .absolute
107
116
117
+ def __le__ (self , other : StateOfCharge ) -> bool :
118
+ return self .absolute <= other .absolute
119
+
108
120
def __gt__ (self , other : StateOfCharge ) -> bool :
109
121
return self .absolute > other .absolute
110
122
0 commit comments