mbruggmann / osx-edid-overrides

Generate a EDID override file that forces Mac OSX to use RGB colour for external displays
77 stars 7 forks source link

Fix a Special Device ID for a LG TV #10

Closed TomHeaven closed 2 years ago

TomHeaven commented 2 years ago

Thanks for the awesome tool that automatically fixes the color mode problem for external monitor. However, I encounter a small problem on macOS Big Sur 11.6.5 when trying to fix display on a LG TV with device ID 0x0001.

The program generates a file named "DisplayProductID-01", which is not loaded by the OS. I found the working file name is "DisplayProductID-1".

Therefore, we may need to update function path_for_override_file as:

def path_for_override_file(display):
    """
    Determine the path where the override file should be written
    """
    vendorpath = "DisplayVendorID-%0.2x" % display.vendor_id
    productpath = "DisplayProductID-%0.2x" % display.product_id
    if display.product_id < 16: # Tom: fix product id problem for LG TV with product id 0x0001
        productpath = "DisplayProductID-%x" % display.product_id
    return Path('Overrides') / vendorpath / productpath
TomHeaven commented 2 years ago

In fact, I do not get why we use "%0.2x" as the string formatter. I think the function can be updated as :

def path_for_override_file(display):
    """
    Determine the path where the override file should be written
    """
    vendorpath = "DisplayVendorID-%x" % display.vendor_id
    productpath = "DisplayProductID-%x" % display.product_id
    return Path('Overrides') / vendorpath / productpath
mbruggmann commented 2 years ago

👋🏻 Hey @TomHeaven. Thanks for bringing this to my attention, I think you are right. Wanna make a pull request to update the logic, and maybe add an additional testcase for it?