mclarkk / lifxlan

Python library for accessing LIFX devices locally using the official LIFX LAN protocol.
MIT License
503 stars 115 forks source link

Light misclassified as Device #154

Open bdn96 opened 3 years ago

bdn96 commented 3 years ago

when discovering the devices on my network, a light bulb (link to the product for reference: https://www.amazon.it/gp/product/B086HKM88R/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1) is not reported by the following code.

lifx = LifxLAN()
lights= lifx.get_lights()

It is reported, though, by

lifx = LifxLAN()
devices = lifx.get_devices()

Also, when creating the light object directly with

light = Light("XX:XX:XX:XX:XX:XX", "192.168.1.74")

and calling

light.get_power()

the program terminates with:

line 526, in req_with_resp raise WorkflowException("WorkflowException: Did not receive {} from {} (Name: {}) in response to {}".format(str(response_type), str(self.mac_addr), str(self.label), str(msg_type))) lifxlan.errors.WorkflowException: WorkflowException: Did not receive [<class 'lifxlan.msgtypes.LightStatePower'>] from XX:XX:XX:XX:XX:XX (Name: None) in response to <class 'lifxlan.msgtypes.LightGetPower'>

Both when launching the discovery and calling get_power() multiple UDP packets are exchanged between the bulb and the computer (see Wireshark screenshot attached).

image

mclarkk commented 3 years ago

A recent update to products.py (#153) might fix this...want to pull the latest and see if it works now?