Skip to content

Commit

Permalink
Fix issue: rounding float value for txpower and rxpower (#320)
Browse files Browse the repository at this point in the history
- Description
For cmis cable, tx power and rx power is not rounding as other eeprom fields

- Motivation and Context
Fix issue: rounding float value for txpower and rxpower

- How Has This Been Tested?
Manual test
  • Loading branch information
Junchao-Mellanox committed Nov 8, 2022
1 parent 2052a63 commit aa86083
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ def get_transceiver_bulk_status(self):
for i in range(1, self.NUM_CHANNELS + 1):
bulk_status["tx%ddisable" % i] = tx_disable[i-1] if self.get_tx_disable_support() else 'N/A'
bulk_status["tx%dbias" % i] = tx_bias['LaserBiasTx%dField' % i] if self.get_tx_bias_support() else 'N/A'
bulk_status["rx%dpower" % i] = self.mw_to_dbm(rx_power[i - 1]) if self.get_rx_power_support() else 'N/A'
bulk_status["tx%dpower" % i] = self.mw_to_dbm(tx_power[i - 1]) if self.get_tx_power_support() else 'N/A'
bulk_status["rx%dpower" % i] = float("{:.3f}".format(self.mw_to_dbm(rx_power[i - 1]))) if self.get_rx_power_support() else 'N/A'
bulk_status["tx%dpower" % i] = float("{:.3f}".format(self.mw_to_dbm(tx_power[i - 1]))) if self.get_tx_power_support() else 'N/A'

laser_temp_dict = self.get_laser_temperature()
self.vdm_dict = self.get_vdm()
Expand Down

0 comments on commit aa86083

Please sign in to comment.