@@ -130,16 +130,43 @@ class BatteryData(ComponentData):
130130 capacity : float
131131 """The capacity of the battery in Wh (Watt-hour)."""
132132
133- power_lower_bound : float
134- """The maximum discharge power, in watts, represented in the passive sign
135- convention. this will be a negative number, or zero if no discharging is
136- possible.
133+ # pylint: disable=line-too-long
134+ power_inclusion_lower_bound : float
135+ """Lower inclusion bound for battery power in watts.
136+
137+ This is the lower limit of the range within which power requests are allowed for the
138+ battery.
139+
140+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
141+ """
142+
143+ power_exclusion_lower_bound : float
144+ """Lower exclusion bound for battery power in watts.
145+
146+ This is the lower limit of the range within which power requests are not allowed for
147+ the battery.
148+
149+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
137150 """
138151
139- power_upper_bound : float
140- """The maximum charge power, in Watts, represented in the passive sign convention.
141- This will be a positive number, or zero if no charging is possible.
152+ power_inclusion_upper_bound : float
153+ """Upper inclusion bound for battery power in watts.
154+
155+ This is the upper limit of the range within which power requests are allowed for the
156+ battery.
157+
158+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
159+ """
160+
161+ power_exclusion_upper_bound : float
162+ """Upper exclusion bound for battery power in watts.
163+
164+ This is the upper limit of the range within which power requests are not allowed for
165+ the battery.
166+
167+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
142168 """
169+ # pylint: enable=line-too-long
143170
144171 temperature : float
145172 """The (average) temperature reported by the battery, in Celcius (°C)."""
@@ -163,15 +190,18 @@ def from_proto(cls, raw: microgrid_pb.ComponentData) -> BatteryData:
163190 Returns:
164191 Instance of BatteryData created from the protobuf message.
165192 """
193+ raw_power = raw .battery .data .dc .power
166194 battery_data = cls (
167195 component_id = raw .id ,
168196 timestamp = raw .ts .ToDatetime (tzinfo = timezone .utc ),
169197 soc = raw .battery .data .soc .avg ,
170- soc_lower_bound = raw .battery .data .soc .system_bounds .lower ,
171- soc_upper_bound = raw .battery .data .soc .system_bounds .upper ,
198+ soc_lower_bound = raw .battery .data .soc .system_inclusion_bounds .lower ,
199+ soc_upper_bound = raw .battery .data .soc .system_inclusion_bounds .upper ,
172200 capacity = raw .battery .properties .capacity ,
173- power_lower_bound = raw .battery .data .dc .power .system_bounds .lower ,
174- power_upper_bound = raw .battery .data .dc .power .system_bounds .upper ,
201+ power_inclusion_lower_bound = raw_power .system_inclusion_bounds .lower ,
202+ power_exclusion_lower_bound = raw_power .system_exclusion_bounds .lower ,
203+ power_inclusion_upper_bound = raw_power .system_inclusion_bounds .upper ,
204+ power_exclusion_upper_bound = raw_power .system_exclusion_bounds .upper ,
175205 temperature = raw .battery .data .temperature .avg ,
176206 _relay_state = raw .battery .state .relay_state ,
177207 _component_state = raw .battery .state .component_state ,
@@ -191,16 +221,43 @@ class InverterData(ComponentData):
191221 -ve current means supply into the grid.
192222 """
193223
194- active_power_lower_bound : float
195- """The maximum discharge power, in Watts, represented in the passive sign
196- convention. This will be a negative number, or zero if no discharging is
197- possible.
224+ # pylint: disable=line-too-long
225+ active_power_inclusion_lower_bound : float
226+ """Lower inclusion bound for inverter power in watts.
227+
228+ This is the lower limit of the range within which power requests are allowed for the
229+ inverter.
230+
231+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
232+ """
233+
234+ active_power_exclusion_lower_bound : float
235+ """Lower exclusion bound for inverter power in watts.
236+
237+ This is the lower limit of the range within which power requests are not allowed for
238+ the inverter.
239+
240+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
198241 """
199242
200- active_power_upper_bound : float
201- """The maximum charge power, in Watts, represented in the passive sign convention.
202- This will be a positive number, or zero if no charging is possible.
243+ active_power_inclusion_upper_bound : float
244+ """Upper inclusion bound for inverter power in watts.
245+
246+ This is the upper limit of the range within which power requests are allowed for the
247+ inverter.
248+
249+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
250+ """
251+
252+ active_power_exclusion_upper_bound : float
253+ """Upper exclusion bound for inverter power in watts.
254+
255+ This is the upper limit of the range within which power requests are not allowed for
256+ the inverter.
257+
258+ More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
203259 """
260+ # pylint: enable=line-too-long
204261
205262 _component_state : inverter_pb .ComponentState .ValueType
206263 """State of the inverter."""
@@ -218,12 +275,15 @@ def from_proto(cls, raw: microgrid_pb.ComponentData) -> InverterData:
218275 Returns:
219276 Instance of InverterData created from the protobuf message.
220277 """
278+ raw_power = raw .inverter .data .ac .power_active
221279 inverter_data = cls (
222280 component_id = raw .id ,
223281 timestamp = raw .ts .ToDatetime (tzinfo = timezone .utc ),
224282 active_power = raw .inverter .data .ac .power_active .value ,
225- active_power_lower_bound = raw .inverter .data .ac .power_active .system_bounds .lower ,
226- active_power_upper_bound = raw .inverter .data .ac .power_active .system_bounds .upper ,
283+ active_power_inclusion_lower_bound = raw_power .system_inclusion_bounds .lower ,
284+ active_power_exclusion_lower_bound = raw_power .system_exclusion_bounds .lower ,
285+ active_power_inclusion_upper_bound = raw_power .system_inclusion_bounds .upper ,
286+ active_power_exclusion_upper_bound = raw_power .system_exclusion_bounds .upper ,
227287 _component_state = raw .inverter .state .component_state ,
228288 _errors = list (raw .inverter .errors ),
229289 )
0 commit comments