+ def added_counter(old_value, new_value_to_add):
+ if new_value_to_add:
+ if old_value is None:
+ return new_value_to_add
+ return old_value + new_value_to_add
+ return old_value
+
+ self.tx = added_counter(self.tx, if_stats.tx)
+ self.rx = added_counter(self.rx, if_stats.rx)
+ # Add special rx total value if set
+ self.rx = added_counter(self.rx, if_stats.rx_total)