aiaf I created a continous diff solution. It's a starting point and can be adapted to other interesting areas. Finally got a working conversion of the data to json, so I used a json diff that also makes it easy enough to see where things changed.
Just created it, so didn't test anything yet, but you can see the AmbientBrightness changing live for example. I'm sure there are areas where you can monitor things related to the cable bandwith as well that can be found thru IORegistryExplorer.
This script needs jd for the diffing, so run brew install jd first, and then more or less just sh iodiff.sh
#!/bin/bash
CMD="ioreg -l -d0 -w0 -r -c AppleCLCD2 -a \
| sed -e '/^\t*<data>/,/^\t*<\/data>/ { /^\(\t*\)<data>\(.*\)/ { s//\1<string>_data:\2/; h; d; }; /^\t*<\/data>\(.*\)/! { s/^\t\(.*\)/\1/; H; d; }; /^\t*<\/data>\(.*\)/ { s//\1:data_<\/string>/; H; g; s/\n//g; }; }' \
| plutil -convert json -r - -o -"
SLEEP_TIME=5
OLD_FILE="/tmp/iodiff_old.json"
NEW_FILE="/tmp/iodiff_new.json"
# Initialize both files before starting the loop
eval "$CMD" > "$OLD_FILE"
cp "$OLD_FILE" "$NEW_FILE"
print_heading() {
echo "\033[1m$1\033[0m"
}
print_heading "$(date)"
cat "$OLD_FILE"
echo ""
while true; do
eval "$CMD" > "$NEW_FILE"
OUTPUT=$(jd -color "$OLD_FILE" "$NEW_FILE")
if [ ! -z "$OUTPUT" ]; then
print_heading "$(date +"%Y-%m-%d %H:%M:%S")"
echo "$OUTPUT"
fi
mv "$NEW_FILE" "$OLD_FILE"
sleep "$SLEEP_TIME"
done