@@ -394,8 +394,8 @@ def analyze(data: dict) -> dict:
394394 "power" : power ,
395395 "modulation" : ch .get ("modulation" ) or ch .get ("type" , "" ),
396396 "snr" : snr ,
397- "correctable_errors" : ch .get ("corrErrors" , 0 ),
398- "uncorrectable_errors" : ch .get ("nonCorrErrors" , 0 ),
397+ "correctable_errors" : ch .get ("corrErrors" ),
398+ "uncorrectable_errors" : ch .get ("nonCorrErrors" ),
399399 "docsis_version" : "3.0" ,
400400 "health" : health ,
401401 "health_detail" : health_detail ,
@@ -416,8 +416,8 @@ def analyze(data: dict) -> dict:
416416 "power" : power ,
417417 "modulation" : ch .get ("modulation" ) or ch .get ("type" , "" ),
418418 "snr" : snr ,
419- "correctable_errors" : ch .get ("corrErrors" , 0 ),
420- "uncorrectable_errors" : ch .get ("nonCorrErrors" , 0 ),
419+ "correctable_errors" : ch .get ("corrErrors" ),
420+ "uncorrectable_errors" : ch .get ("nonCorrErrors" ),
421421 "docsis_version" : "3.1" ,
422422 "health" : health ,
423423 "health_detail" : health_detail ,
@@ -480,8 +480,8 @@ def analyze(data: dict) -> dict:
480480 us_powers = [c ["power" ] for c in us_channels if c ["power" ] is not None ]
481481 ds_snrs = [c ["snr" ] for c in ds_channels if c ["snr" ] is not None ]
482482
483- total_corr = sum (c ["correctable_errors" ] for c in ds_channels )
484- total_uncorr = sum (c ["uncorrectable_errors" ] for c in ds_channels )
483+ total_corr = sum (c ["correctable_errors" ] for c in ds_channels if c [ "correctable_errors" ] is not None )
484+ total_uncorr = sum (c ["uncorrectable_errors" ] for c in ds_channels if c [ "uncorrectable_errors" ] is not None )
485485
486486 us_bitrates = [c ["theoretical_bitrate" ] for c in us_channels if c ["theoretical_bitrate" ] is not None ]
487487 us_capacity = round (sum (us_bitrates ), 1 ) if us_bitrates else None
0 commit comments