Open ath0rus opened 1 year ago
my code is as follows `from lifxlan import LifxLAN import time
def main():
lifx = LifxLAN(1) # 1 light
# Get the first light
light = lifx.get_lights()[0]
# Store the current color
original_color = light.get_color()
# Set the light to red
red_color = [65535, 65535, 65535, 3500] # [Hue, Saturation, Brightness, Kelvin]
light.set_color(red_color, rapid=True)
# Wait for 3 seconds
time.sleep(3)
# Revert to the original color
light.set_color(original_color, rapid=True)
if name == "main": main()`
curtsy of chatgpt4
facing same issue :(
I'm getting hit by this as well now. I thought it was my own inputs to set_zone_colors() but seeing this here is worrying...
Ok I'm digging in a bit here and it looks like bitstring is another package. Lifxlan is using bitstring.pack() in message.py in order to send information to the light. I would suspect that is where the error lives.
It might be possible to load an older version of bitstring. It appears as of 4.1.0 this was disallowed.
I had a similar issue a while back. This is the feedback pedantic79 sent me privately:
The problem is that the current version of lifxlan only works with v3 of bitstring, and you have v4 of bitstring. So your options are:
If you pip install lifxlan, then run pip list, you should see bitstring 4.0.2 (or some other version 4 bitstring package). To fix this run pip install bitstring==3.1.9, this will force your install to work.
Rather than installing in a global python package directory, consider using venv. Once your venv is activated, then follow the instructions in 1. This solution is useful if you have other things that depend on bitstring and installing bitstring==3.1.9 will conflict globally.
Wait until there is a version of lifxlan that supports bitstring
——
Nice! I figured that would work. Unfortunately I'm running this in home assistant which appears to be running bitstring 4 so I'll have to find another solution.
I had a similar issue a while back. This is the feedback pedantic79 sent me privately:
The problem is that the current version of lifxlan only works with v3 of bitstring, and you have v4 of bitstring. So your options are:
- If you pip install lifxlan, then run pip list, you should see bitstring 4.0.2 (or some other version 4 bitstring package). To fix this run pip install bitstring==3.1.9, this will force your install to work.
- Rather than installing in a global python package directory, consider using venv. Once your venv is activated, then follow the instructions in 1. This solution is useful if you have other things that depend on bitstring and installing bitstring==3.1.9 will conflict globally.
- Wait until there is a version of lifxlan that supports bitstring
——
1 worked for me although a longer-term fix would be better. I discovery issues and crashes.
as the title suggests I keep getting
It's no longer possible to auto initialise a bitstring from an integer. Use 'Bits(0)' instead of just '0' as this makes it clearer that a bitstring of 0 zero bits will be created.
when ever I try to use the library, is there something im doing wrong and how can i fix it