@@ -257,16 +257,23 @@ def extra_state_attributes(self):
257257 }
258258 case key if key in (
259259 "today_feeding_quantity_weight" ,
260+ "last_feed_quantity_weight" ,
261+ "next_feed_quantity_weight" ,
262+ ):
263+ portion = getattr (self .device , key .removesuffix ("_weight" ), 0 )
264+ return {
265+ unit .symbol : Unit .convert_feed (portion * self .device .feed_conv_factor , None , unit , True )
266+ for unit in (Unit .GRAMS , Unit .OUNCES )
267+ }
268+ case key if key in (
260269 "today_feeding_quantity_volume" ,
261- "last_feed_quantity_weight" ,
262270 "last_feed_quantity_volume" ,
263- "next_feed_quantity_weight" ,
264271 "next_feed_quantity_volume"
265272 ):
266- portion = getattr (self .device , key .removesuffix (f"_ { self . device_class } " ), 0 )
267- return {"portion" : portion } | {
273+ portion = getattr (self .device , key .removesuffix ("_volume " ), 0 )
274+ return {
268275 unit .symbol : Unit .convert_feed (portion * self .device .feed_conv_factor , None , unit , True )
269- for unit in VALID_UNIT_TYPES [ API . FEED_UNIT ] if unit
276+ for unit in ( Unit . CUPS , Unit . MILLILITERS )
270277 }
271278 case key if key in (
272279 "remaining_water" ,
0 commit comments