Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Turn off lights at startup script #151

Closed
afsilvasantos opened this issue Sep 25, 2020 · 5 comments
Closed

Turn off lights at startup script #151

afsilvasantos opened this issue Sep 25, 2020 · 5 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@afsilvasantos
Copy link

Hi,

Is there any function that allows to disable all lights at startup?

@ixjf
Copy link
Owner

ixjf commented Sep 25, 2020

You can call Lighting.SetAllEnabled with first parameter = false. If a script was left running when Windows shutdown, it'll auto-start with Windows as well, so this would have the desired effect.

So a script like this:

Lighting.SetAllEnabled(false)

@afsilvasantos
Copy link
Author

Ok thanks! That worked out. However i run the script, but when i restart the lights are on again. shouldn't the script run automatically now?

@ixjf
Copy link
Owner

ixjf commented Sep 30, 2020

If you ran the script and didn't stop it at any point, it should. I see two options:

@ixjf ixjf self-assigned this Feb 4, 2021
@ixjf ixjf added the bug Something isn't working label Feb 4, 2021
@ronangelo
Copy link

I have a B450M MB and wanted to disable the lights at startup too. I managed to get it working with this:

Lighting.SetAllEnabled(true)

os.sleep( 500 )

Lighting.SetAllEnabled( false )

I'm not sure which fixed my issue though. Either setting the Lighting.SetAllEnabled to True before disabling OR messing with the service's startup type. I initially set it to Automatic (Delayed Start) but changed it back to Automatic. It's working so far since then.

@ixjf ixjf added the duplicate This issue or pull request already exists label Aug 22, 2021
ixjf added a commit that referenced this issue Aug 23, 2021
@ixjf
Copy link
Owner

ixjf commented Aug 23, 2021

I updated the scripts to fix this issue. You can see the last comment in #159 (the one with the code example) to see how to apply it to your own code.

@ixjf ixjf closed this as completed Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants