[Breaking Change] Cleanup Lutron light component (#18650)

Remove the return value from setup_platform
Convert LutronLight.__init__ to use super() when referencing the parent class.
Change device_state_attributes() to use lowercase snakecase (Rename 'Lutron Integration ID' to 'lutron_integration_id')
This commit is contained in:
cdheiser 2018-11-22 23:54:28 -08:00 committed by Paulus Schoutsen
parent bb37151987
commit 98f159a039

View file

@ -24,7 +24,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
devs.append(dev)
add_entities(devs, True)
return True
def to_lutron_level(level):
@ -43,7 +42,7 @@ class LutronLight(LutronDevice, Light):
def __init__(self, area_name, lutron_device, controller):
"""Initialize the light."""
self._prev_brightness = None
LutronDevice.__init__(self, area_name, lutron_device, controller)
super().__init__(self, area_name, lutron_device, controller)
@property
def supported_features(self):
@ -77,7 +76,7 @@ class LutronLight(LutronDevice, Light):
def device_state_attributes(self):
"""Return the state attributes."""
attr = {}
attr['Lutron Integration ID'] = self._lutron_device.id
attr['lutron_integration_id'] = self._lutron_device.id
return attr
@property