LenovoLegionToolkit icon indicating copy to clipboard operation
LenovoLegionToolkit copied to clipboard

[FEAT]: light usb ports

Open AceAsket opened this issue 2 years ago • 7 comments

Version

2.6.0

OS

Windows 11

Device

Legion Y9000X IAH7

Is your feature request related to a problem?

usb panel illumination image translated

How would you like the problem to be solved?

turn it on/off

What alternatives have you considered?

use legion zone or hotkeys

Additional information

No response

AceAsket avatar Sep 24 '22 23:09 AceAsket

I don't know which interface these controls are using, so I will be needed some help to add this toggle.

Just out of curiosity, can you use the Fn+U or Fn+L shortcut to turn these on/off?

BartoszCichecki avatar Sep 25 '22 13:09 BartoszCichecki

yes FN + U worked

AceAsket avatar Sep 26 '22 09:09 AceAsket

I don't know which interface these controls are using, so I will be needed some help to add this toggle.

Just out of curiosity, can you use the Fn+U or Fn+L shortcut to turn these on/off?

will this be added to the plan?

AceAsket avatar Oct 08 '22 18:10 AceAsket

If someone reverse engineers, how are they controlled then yes.

BartoszCichecki avatar Oct 08 '22 18:10 BartoszCichecki

Hi @BartoszCichecki, you may implement that by using this script.

function Toggle-RearUSBLightingState {
    $LenovoWMIPath=(Get-WmiObject -Namespace "root\WMI" -Query "SELECT * FROM LENOVO_LIGHTING_METHOD").__PATH
    $LenovoWMI=[WMI]$LenovoWMIPath
    $LightingID=5
    $CurrentState=$LenovoWMI.Get_Lighting_Current_Status($LightingID).Current_State_Type
    $TargetState=[int]($CurrentState -xor 1)
    $LenovoWMI.Set_Lighting_Current_Status($LightingID,$TargetState,0)
    
}
function Toggle-LogoLightingState {
    $LenovoWMIPath=(Get-WmiObject -Namespace "root\WMI" -Query "SELECT * FROM LENOVO_LIGHTING_METHOD").__PATH
    $LenovoWMI=[WMI]$LenovoWMIPath
    $LightingID=3
    $CurrentState=$LenovoWMI.Get_Lighting_Current_Status($LightingID).Current_State_Type
    $TargetState=[int]($CurrentState -xor 1)
    $LenovoWMI.Set_Lighting_Current_Status($LightingID,$TargetState,0)
    
}

RoadToDream avatar Oct 13 '22 01:10 RoadToDream

@RoadToDream do you know if more could be done via this interface? Anything more than USB ports and logo lights?

BartoszCichecki avatar Oct 13 '22 07:10 BartoszCichecki

There should be more for different versions of BIOS, but for mine I guess that's all. There are also some methods that helps implementing Spectrum via other interface. But that is not related to this issue.

RoadToDream avatar Oct 13 '22 07:10 RoadToDream

Hey, @RoadToDream you have an idea how to check for compatibility of this feature? I can execute these commands on L5P which doesn't have backlight of ports. I need to check somehow if device supports it, so that I don't show this on device like L5P.

BartoszCichecki avatar Oct 16 '22 21:10 BartoszCichecki

Hey, @RoadToDream you have an idea how to check for compatibility of this feature? I can execute these commands on L5P which doesn't have backlight of ports. I need to check somehow if device supports it, so that I don't show this on device like L5P.

WMI call should return a code where code 3 should be error. If that doesn't work, maybe a BIOS version whitelist is good I guess.

RoadToDream avatar Oct 17 '22 02:10 RoadToDream

Closing since there doesn't seem to be a consistent interface for this that would allow:

  1. Checking if devices has support for this
  2. How to reliably turn it on/off an a wide range of devices.

In general looks like Lenovo has a very complex/broken logic for this.

If someone comes up with a solution to this make a PR.

BartoszCichecki avatar Feb 17 '23 12:02 BartoszCichecki