########################################################################
# Copyright (C) 2009-2010 Richard Hughes <richard@hughsie.com>
#
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Colorimeter devices used for profiling
#
# These are properties defining the behavior:
#  COLORD_SENSOR		Can measure color
#  COLORD_SENSOR_KIND		The kind of sensor
#  COLORD_SENSOR_CAP_LCD	Can profile a LCD display device
#  COLORD_SENSOR_CAP_LCD	Can profile a CRT display device
#  COLORD_SENSOR_CAP_PROJECTOR	Can profile a projector device
#  COLORD_SENSOR_CAP_PRINTER	Can profile a printer device
#  COLORD_SENSOR_CAP_SPOT	Can be used for spot measurements
#  COLORD_SENSOR_CAP_AMBIENT	Can be used for ambient measurements
#

# Skip all this to speed things up if it'a not a usb add.
ACTION!="add", GOTO="gcm_rules_end"
SUBSYSTEM!="usb", GOTO="gcm_rules_end"
DRIVER!="usb", GOTO="gcm_rules_end"

# DTP20
ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d020", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="dtp20", ENV{COLORD_SENSOR_CAP_PRINTER}="1", ENV{COLORD_SENSOR_CAP_SPOT}="1"

# DTP92Q (not tested)
ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d092", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="unknown", ENV{COLORD_SENSOR_CAP_CRT}="1"

# DTP94
ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d094", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="dtp94", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1"

# MonacoOPTIX (Same as i1 Display 1)
ATTRS{idVendor}=="0670", ATTRS{idProduct}=="0001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1"

# i1Display
ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2003", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1"

# i1Monitor
ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1"

# i1Pro
ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2000", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1", ENV{COLORD_SENSOR_CAP_PRINTER}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# i1Display3
ATTRS{idVendor}=="0765", ATTRS{idProduct}=="5020", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-display3", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# ColorMunki
ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2007", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="color-munki", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1", ENV{COLORD_SENSOR_CAP_PRINTER}="1", ENV{COLORD_SENSOR_CAP_SPOT}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# Colorimtre HCFR
ATTRS{idVendor}=="04db", ATTRS{idProduct}=="005b", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorimtre-hcfr", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1"

# Spyder 2
ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0200", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="spyder2", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1"

# Spyder 3
ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0300", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="spyder3", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# Huey
ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2005", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="huey", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# Huey, built into Thinkpad w700
ATTRS{idVendor}=="0765", ATTRS{idProduct}=="5001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="huey", ENV{COLORD_SENSOR_CAP_LCD}="1", ENV{COLORD_SENSOR_CAP_CRT}="1", ENV{COLORD_SENSOR_CAP_AMBIENT}="1"

# ColorHug (legacy)
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f8da", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_SENSOR_CAP_LCD}="1"

# ColorHug
ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1000", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_IGNORE}="1"
ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug", ENV{COLORD_SENSOR_CAP_LCD}="1"

# ColorHug Spectro
ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1003", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug-spectro", ENV{COLORD_IGNORE}="1"
ATTRS{idVendor}=="273f", ATTRS{idProduct}=="1002", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorhug-spectro", ENV{COLORD_SENSOR_CAP_LCD}="1"

# color calibration device
ENV{COLORD_SENSOR}=="*?", ENV{COLOR_MEASUREMENT_DEVICE}="1"
ENV{COLORD_SENSOR}=="*?", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
ENV{COLORD_SENSOR}=="*?", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"

# Allow the daemon to access the color devices
ENV{COLORD_SENSOR}=="*?", GROUP="root"

LABEL="gcm_rules_end"
