seydx / homebridge-printer

Homebridge plugin for ipp (AirPrint) capable printer
MIT License
42 stars 4 forks source link

Support for Printer with only one Marker #5

Closed fototeddy closed 3 years ago

fototeddy commented 3 years ago

reagarding to this issue https://github.com/SeydX/homebridge-printer/issues/4 I found out, that it is cause by the fact that mit printer has only one marker so attributes['marker-names'] and attributes['marker-levels'] is not an array and so .forEach will not work. This will also result in, that the contact sensor is never triggered and so the whole plugin is not working

I just put the to variables into [] and so thy are arrays of one and everything will work fine.

maybe you can test ist with a printer with more than one marker if it still works there

seydx commented 3 years ago

Thx for the PR and sry for the late response. I updated your PR, should work as intended now