@@ -831,7 +831,7 @@ def set_visible(plus_account_id:Optional[str], item:ScheduledItem) -> None:
831831# returns blend name or None and list of components (just one if item is about a coffee
832832def scheduleditem_beans_descriptions (weight_unit_idx :int , item :ScheduledItem ) -> Tuple [Optional [str ], List [Tuple [float ,str ]]]:
833833 if item .blend is not None :
834- blends = plus .stock .getBlends (weight_unit_idx , item .store )
834+ blends = plus .stock .getStandardBlends (weight_unit_idx , item .store )
835835 blend = next ((b for b in blends if plus .stock .getBlendId (b ) == item .blend and plus .stock .getBlendStockDict (b )['location_hr_id' ] == item .store ), None )
836836 if blend is not None :
837837 return plus .stock .blend2ratio_beans (blend , item .weight , html_escape = False )
@@ -840,6 +840,7 @@ def scheduleditem_beans_descriptions(weight_unit_idx:int, item:ScheduledItem) ->
840840 coffee = plus .stock .getCoffee (item_coffee )
841841 if coffee is not None :
842842 return None , [(1 ,plus .stock .coffeeLabel (coffee ))]
843+ _log .error ('scheduleditem_beans_descriptions(%s,%s) could not be resolved' , weight_unit_idx , item )
843844 return None , []
844845
845846def scheduleditem_beans_description (weight_unit_idx :int , item :ScheduledItem ) -> str :
@@ -853,7 +854,7 @@ def scheduleditem_beans_description(weight_unit_idx:int, item:ScheduledItem) ->
853854 store_label = f'<br>[{ html .escape (store_label )} ]'
854855 beans_description = f'<b>{ html .escape (plus .stock .coffeeLabel (coffee ))} </b>{ store_label } '
855856 else :
856- blends = plus .stock .getBlends (weight_unit_idx , item .store )
857+ blends = plus .stock .getStandardBlends (weight_unit_idx , item .store )
857858 blend = next ((b for b in blends if plus .stock .getBlendId (b ) == item .blend and plus .stock .getBlendStockDict (b )['location_hr_id' ] == item .store ), None )
858859 if blend is not None :
859860 blend_lines = '' .join ([f'<tr><td>{ html .escape (bl [0 ])} </td><td>{ html .escape (bl [1 ])} </td></tr>'
@@ -2787,7 +2788,7 @@ def set_roast_properties(self, item:ScheduledItem, overwrite_nondefault_title:bo
27872788 except Exception as e : # pylint: disable=broad-except
27882789 _log .error (e )
27892790 elif item .blend is not None :
2790- blends :List [plus .stock .BlendStructure ] = plus .stock .getBlends (weight_unit_idx , item .store )
2791+ blends :List [plus .stock .BlendStructure ] = plus .stock .getStandardBlends (weight_unit_idx , item .store )
27912792 # NOTE: a blend might not have an hr_id as is the case for all custom blends
27922793 blend_structure :Optional [plus .stock .BlendStructure ] = next ((bs for bs in blends if plus .stock .getBlendId (bs ) == item .blend ), None )
27932794 if blend_structure is not None :
@@ -3908,9 +3909,9 @@ def show_item(self, item:'WeightItem', state:PROCESS_STATE = PROCESS_STATE.DISCO
39083909
39093910 self .rendered_task ['timer' ] = 0 # clear timer start trigger immediately
39103911
3911-
39123912 # current_weight indicates total measured weight over both containers in g (not including the bucket weights)
39133913 def show_progress (self , state :PROCESS_STATE , component :int , bucket :int , current_weight :int ) -> None :
3914+ # _log.debug("PRINT show_progress(%s,%s,%s,%s)",state,component,bucket,current_weight)
39143915 if (self .last_item is not None and (self .last_process_state != state or self .last_component != component or self .last_bucket != bucket or
39153916 self .last_current_weight != current_weight )):
39163917 self .last_process_state = state
@@ -3927,6 +3928,7 @@ def show_progress(self, state:PROCESS_STATE, component:int, bucket:int, current_
39273928 self .rendered_task ['blend_percent' ] = ''
39283929 self .rendered_task ['subtitle' ] = ''
39293930 self .rendered_task ['bucket' ] = bucket
3931+
39303932 if state == PROCESS_STATE .WEIGHING and len (self .last_item .descriptions )> component and len (self .last_item .descriptions [component ])> 0 :
39313933 target = self .last_item .weight * 1000 # target in g
39323934 self .rendered_task ['total_percent' ] = 100 * current_weight / target
0 commit comments