Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions homeassistant/components/lutron_caseta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def __init__(self, device, bridge):

async def async_added_to_hass(self):
"""Register callbacks."""
self._smartbridge.add_subscriber(
self.device_id, self.async_schedule_update_ha_state
)
self._smartbridge.add_subscriber(self.device_id, self.async_write_ha_state)

@property
def device_id(self):
Expand All @@ -108,7 +106,7 @@ def unique_id(self):
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {"Device ID": self.device_id, "Zone ID": self._device["zone"]}
attr = {"device_id": self.device_id, "zone_id": self._device["zone"]}
return attr

@property
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/lutron_caseta/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta shades as a cover device."""
devs = []
entities = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
cover_devices = bridge.get_devices_by_domain(DOMAIN)
for cover_device in cover_devices:
dev = LutronCasetaCover(cover_device, bridge)
devs.append(dev)
entity = LutronCasetaCover(cover_device, bridge)
entities.append(entity)

async_add_entities(devs, True)
async_add_entities(entities, True)


class LutronCasetaCover(LutronCasetaDevice, CoverDevice):
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/lutron_caseta/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def to_hass_level(level):

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta lights."""
devs = []
entities = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
light_devices = bridge.get_devices_by_domain(DOMAIN)
for light_device in light_devices:
dev = LutronCasetaLight(light_device, bridge)
devs.append(dev)
entity = LutronCasetaLight(light_device, bridge)
entities.append(entity)

async_add_entities(devs, True)
async_add_entities(entities, True)


class LutronCasetaLight(LutronCasetaDevice, Light):
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/lutron_caseta/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta lights."""
devs = []
entities = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
scenes = bridge.get_scenes()
for scene in scenes:
dev = LutronCasetaScene(scenes[scene], bridge)
devs.append(dev)
entity = LutronCasetaScene(scenes[scene], bridge)
entities.append(entity)

async_add_entities(devs, True)
async_add_entities(entities, True)


class LutronCasetaScene(Scene):
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/lutron_caseta/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up Lutron switch."""
devs = []
entities = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
switch_devices = bridge.get_devices_by_domain(DOMAIN)

for switch_device in switch_devices:
dev = LutronCasetaLight(switch_device, bridge)
devs.append(dev)
entity = LutronCasetaLight(switch_device, bridge)
entities.append(entity)

async_add_entities(devs, True)
async_add_entities(entities, True)
return True


Expand Down