mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fixes for lint
This commit is contained in:
parent
711f2da496
commit
99286391e1
@ -42,7 +42,7 @@ TEMP_MIN_HASS = 154 # home assistant minimum temperature
|
|||||||
TEMP_MAX_HASS = 500 # home assistant maximum temperature
|
TEMP_MAX_HASS = 500 # home assistant maximum temperature
|
||||||
|
|
||||||
|
|
||||||
class lifx_api():
|
class LIFX():
|
||||||
def __init__(self, add_devices_callback,
|
def __init__(self, add_devices_callback,
|
||||||
server_addr=None, broadcast_addr=None):
|
server_addr=None, broadcast_addr=None):
|
||||||
self._devices = []
|
self._devices = []
|
||||||
@ -63,6 +63,7 @@ class lifx_api():
|
|||||||
break
|
break
|
||||||
return bulb
|
return bulb
|
||||||
|
|
||||||
|
# pylint: disable=too-many-arguments
|
||||||
def on_device(self, ipaddr, name, power, hue, sat, bri, kel):
|
def on_device(self, ipaddr, name, power, hue, sat, bri, kel):
|
||||||
bulb = self.find_bulb(ipaddr)
|
bulb = self.find_bulb(ipaddr)
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ class lifx_api():
|
|||||||
self._devices.append(bulb)
|
self._devices.append(bulb)
|
||||||
self._add_devices_callback([bulb])
|
self._add_devices_callback([bulb])
|
||||||
|
|
||||||
|
# pylint: disable=too-many-arguments
|
||||||
def on_color(self, ipaddr, hue, sat, bri, kel):
|
def on_color(self, ipaddr, hue, sat, bri, kel):
|
||||||
bulb = self.find_bulb(ipaddr)
|
bulb = self.find_bulb(ipaddr)
|
||||||
|
|
||||||
@ -86,15 +88,13 @@ class lifx_api():
|
|||||||
bulb.set_power(power)
|
bulb.set_power(power)
|
||||||
bulb.update_ha_state()
|
bulb.update_ha_state()
|
||||||
|
|
||||||
|
# pylint: disable=unused-argument
|
||||||
def poll(self, now):
|
def poll(self, now):
|
||||||
self.probe()
|
self.probe()
|
||||||
|
|
||||||
def probe(self, address=None):
|
def probe(self, address=None):
|
||||||
self._liffylights.probe(address)
|
self._liffylights.probe(address)
|
||||||
|
|
||||||
def state(self, power):
|
|
||||||
return "on" if power else "off"
|
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
@ -102,7 +102,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
server_addr = config.get(CONF_SERVER, None)
|
server_addr = config.get(CONF_SERVER, None)
|
||||||
broadcast_addr = config.get(CONF_BROADCAST, None)
|
broadcast_addr = config.get(CONF_BROADCAST, None)
|
||||||
|
|
||||||
lifx_library = lifx_api(add_devices_callback, server_addr, broadcast_addr)
|
lifx_library = LIFX(add_devices_callback, server_addr, broadcast_addr)
|
||||||
|
|
||||||
# register our poll service
|
# register our poll service
|
||||||
track_time_change(hass, lifx_library.poll, second=10)
|
track_time_change(hass, lifx_library.poll, second=10)
|
||||||
@ -125,9 +125,9 @@ def convert_rgb_to_hsv(rgb):
|
|||||||
class LIFXLight(Light):
|
class LIFXLight(Light):
|
||||||
""" Provides LIFX light. """
|
""" Provides LIFX light. """
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, liffylights, ipaddr, name, power, hue,
|
def __init__(self, liffy, ipaddr, name, power, hue,
|
||||||
saturation, brightness, kelvin):
|
saturation, brightness, kelvin):
|
||||||
self._liffylights = liffylights
|
self._liffylights = liffy
|
||||||
self._ip = ipaddr
|
self._ip = ipaddr
|
||||||
self.set_name(name)
|
self.set_name(name)
|
||||||
self.set_power(power)
|
self.set_power(power)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user