InfotelGLPI / printercounters

Plugin Printercounters for GLPI
http://blogglpi.infotel.com
GNU General Public License v2.0
14 stars 9 forks source link

getTonerData() function doesn't handle Hex-STRING values #81

Open eduardomozart opened 3 years ago

eduardomozart commented 3 years ago
  1. Go to "Tools" > "Printer counters".

  2. Click on "Record models".

  3. Select the record model from HP Laserjet M551 printer

  4. Set "Enable toner level" to "Yes".

  5. Goto "Assets" > "Printers".

  6. Click on HP Laserjet M551 printer

It should show the cartridge name and the percentage bar with the specific cartridge color, as below:

2020-11-23 13_14_42-Greenshot

But it's actually return Hex-STRING values and the progress bar has no color at all:

2020-11-23 13_15_02-Greenshot

It happens because the getTonerData() function doesn't handle Hex-STRING values and HP Laserjet M551 printer return the cartridge type ('black', etc.) and name as Hex-STRINGS. I sent a Pull Request with a possible fix.