I've been struggling with this for hours, i'm not a python dev, i'm just trying to control my lights with my linux pc
#!/usr/bin/env python
import sys
from lifxlan import LifxLAN
def main ():
lan = LifxLAN()
light = Light("bettersafethansorrymacaddress", "withprivacyipaddress")
light.set_power(65535, 0.2)
if __name__=="__main__":
main()
Traceback (most recent call last):
File "/home/communist/.config/tofi/scripts/fromscratch.py", line 13, in <module>
main()
File "/home/communist/.config/tofi/scripts/fromscratch.py", line 10, in main
light = Light("privacy", "sostillremoved")
^^^^^
NameError: name 'Light' is not defined. Did you mean: 'light'?
I have no idea why this doesn't work, it says light isn't defined, i'm sure i'm doing a number of things wrong, but a very basic on/off switch example for a specific light using the specific device example would be extremely helpful for me.
The closest things in the examples that I see affect random lights, so, I just really don't know how to work with this.
edit:
I HAVE SOLVED IT ON MY OWN IT WAS A MISSING IMPORT THANK YOU ME
#!/usr/bin/env python
import sys
from lifxlan import LifxLAN, Light
def main ():
computer = Light("mac", "ip")
computer.set_power(65535, 0.2)
if __name__=="__main__":
main()
I've been struggling with this for hours, i'm not a python dev, i'm just trying to control my lights with my linux pc
I have no idea why this doesn't work, it says light isn't defined, i'm sure i'm doing a number of things wrong, but a very basic on/off switch example for a specific light using the specific device example would be extremely helpful for me.
The closest things in the examples that I see affect random lights, so, I just really don't know how to work with this.
edit:
I HAVE SOLVED IT ON MY OWN IT WAS A MISSING IMPORT THANK YOU ME