pylint and handle all bulbs toggle boolean
@@ -48,16 +48,18 @@ def list_bulbs():
url=lifx_url+'all',
headers=auth_header
)
- resp = response
- print(response.json())
+ resp = response.json()
+ print(resp)
response.close()
-def toggle_bulbs(selector, all=False, duration=0):
+def toggle_bulbs(selector, all_bulbs=False, duration=0):
"""Toggles current state of LIFX bulb(s).
:param dict selector: Selector to control which bulbs are requested.
:param bool all: Toggle all bulbs at once. Defaults to false.
:param double duration: Time (in seconds) to spend performing a toggle. Defaults to 0.
"""
+ if all_bulbs:
+ selector = 'all'
response = wifi.post(
url=lifx_url+selector+'/toggle',
headers = auth_header,
