IPP: Remember ink levels when printer goes to sleep

Currently, when using the Internet Printing Protocol (IPP) integration to monitor printer ink levels, all cartridge sensors revert to “Unknown” as soon as the printer is turned off. While this makes sense for traditional smart home sensors (like temperature sensors), printers are often turned off when not in use, meaning that dashboards end up displaying “Unknown” most of the time.

Since ink levels don’t change while a printer is turned off, it makes the most sense to store the last-received ink level value for each ink level sensor, so that it can continue to be used when the printer is turned off.


This change was originally suggested by GitHub user ricarva in an issue comment.