mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
[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:
parent
bb37151987
commit
98f159a039
@ -24,7 +24,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
devs.append(dev)
|
devs.append(dev)
|
||||||
|
|
||||||
add_entities(devs, True)
|
add_entities(devs, True)
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def to_lutron_level(level):
|
def to_lutron_level(level):
|
||||||
@ -43,7 +42,7 @@ class LutronLight(LutronDevice, Light):
|
|||||||
def __init__(self, area_name, lutron_device, controller):
|
def __init__(self, area_name, lutron_device, controller):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self._prev_brightness = None
|
self._prev_brightness = None
|
||||||
LutronDevice.__init__(self, area_name, lutron_device, controller)
|
super().__init__(self, area_name, lutron_device, controller)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
@ -77,7 +76,7 @@ class LutronLight(LutronDevice, Light):
|
|||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attr = {}
|
attr = {}
|
||||||
attr['Lutron Integration ID'] = self._lutron_device.id
|
attr['lutron_integration_id'] = self._lutron_device.id
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user