Add support for IPP Printers to CUPS integration (#9690)

* Add support for IPP Printers to CUPS integration

* Update source/_components/cups.markdown

Co-Authored-By: Klaas Schoute <klaas_schoute@hotmail.com>
This commit is contained in:
Matte23 2019-06-26 01:13:47 +02:00 committed by Paulus Schoutsen
parent 804bee2294
commit 4938733ed1

View File

@ -17,14 +17,17 @@ redirect_from:
---
The `cups` sensor platform is using the open source printing system [CUPS](https://www.cups.org/) to show details about your printers.
The `cups` sensor platform is using the open source printing system [CUPS](https://www.cups.org/) to show details about your printers. It can obtain the informations using a CUPS server or communicating directly with the printer with the Internet Printing Protocol.
To set up the sensor the "Queue Name" of the printer is needed. The fastest way to get it, is to visit the CUPS web interface at "http://[IP ADDRESS PRINT SERVER]:631" and go to "Printers".
If you want to use an existing CUPS server the "Queue Name" of the printer is needed. The fastest way to get it, is to visit the CUPS web interface at "http://[IP ADDRESS PRINT SERVER]:631" and go to "Printers".
<p class='img'>
<img src='{{site_root}}/images/screenshots/cups-sensor.png' />
</p>
If you want to communicate directly with the printer, you need the IP, the port number and the "Printer Name". Also your printer must support the IPP protocol. The port number is usually 631, while the "Printer Name" is usually "ipp/print". Remember to set "is_cups_server" to false.
If the platform fails to load with those settings, you can look into the web interface of your printer for the port number and the "Printer Name". The procedure is different for different models.
To enable the CUPS sensor, add the following lines to your `configuration.yaml`:
```yaml
@ -38,21 +41,40 @@ sensor:
{% configuration %}
printers:
description: List of printers to add.
description: List of printers to add. If you're not using a CUPS server, add here your "Printer Name".
required: true
type: list
host:
description: IP address of the CUPS print server.
description: The IP address of the CUPS print server or of the printer.
required: false
type: string
default: 127.0.0.1
port:
description: Port of the CUPS print server.
description: The port number of the CUPS print server or of the printer.
required: false
type: integer
default: 631
is_cups_server:
description: Set true if you want to use a CUPS print server, set false otherwise.
required: false
type: boolean
default: true
{% endconfiguration %}
## {% linkable_title Examples %}
Default configuration for an IPP printer:
```yaml
# Example configuration.yaml entry for an IPP printer
sensor:
- platform: cups
host: PRINTER_IP
is_cups_server: false
printers:
- ipp/print
```
<p class='note'>
You will need to install the `python3-dev` or `python3-devel` and the development files for CUPS (`libcups2-dev` or`cups-devel`) package on your system manually (eg. `sudo apt-get install python3-dev libcups2-dev` or `sudo dnf -y install python3-devel cups-devel`) along with a compiler (`gcc`).
</p>