File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,7 @@ def _appliance_measurements(
604604 # Count only the items in the binary_sensors, sensors and
605605 # switches dicts, and the single data items in data
606606 total_bsssw_dict_items = sum (
607- len (data .get (key , {})) for key in [ "binary_sensors" , "sensors" , "switches" ]
607+ len (data .get (key , {})) for key in ( "binary_sensors" , "sensors" , "switches" )
608608 )
609609 self ._count += total_bsssw_dict_items + len (data ) - len (
610610 [k for k in data if isinstance (data [k ], dict )]
Original file line number Diff line number Diff line change @@ -360,11 +360,14 @@ def _appliance_measurements(
360360 appl_i_loc .text , ENERGY_WATT_HOUR
361361 )
362362
363- self ._count += len (data ["binary_sensors" ])
364- self ._count += len (data ["sensors" ])
365- self ._count += len (data ["switches" ])
366- # Don't count the above top-level dicts, only the remaining single items
367- self ._count += len (data ) - 3
363+ # Count only the items in the binary_sensors, sensors and
364+ # switches dicts, and the single data items in data
365+ total_bsssw_dict_items = sum (
366+ len (data .get (key , {})) for key in ("binary_sensors" , "sensors" , "switches" )
367+ )
368+ self ._count += total_bsssw_dict_items + len (data ) - len (
369+ [k for k in data if isinstance (data [k ], dict )]
370+ )
368371
369372 def _get_actuator_functionalities (
370373 self ,
You can’t perform that action at this time.
0 commit comments