mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Fix missing device info in lutron_caseta (#71156)
- There was a missing return due to a bad merge conflict resolution - Fixes #71154
This commit is contained in:
parent
e7bcf839ac
commit
db53b3cbe0
@ -294,6 +294,8 @@ async def async_unload_entry(
|
|||||||
class LutronCasetaDevice(Entity):
|
class LutronCasetaDevice(Entity):
|
||||||
"""Common base class for all Lutron Caseta devices."""
|
"""Common base class for all Lutron Caseta devices."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, device, bridge, bridge_device):
|
def __init__(self, device, bridge, bridge_device):
|
||||||
"""Set up the base class.
|
"""Set up the base class.
|
||||||
|
|
||||||
@ -304,6 +306,18 @@ class LutronCasetaDevice(Entity):
|
|||||||
self._device = device
|
self._device = device
|
||||||
self._smartbridge = bridge
|
self._smartbridge = bridge
|
||||||
self._bridge_device = bridge_device
|
self._bridge_device = bridge_device
|
||||||
|
info = DeviceInfo(
|
||||||
|
identifiers={(DOMAIN, self.serial)},
|
||||||
|
manufacturer=MANUFACTURER,
|
||||||
|
model=f"{device['model']} ({device['type']})",
|
||||||
|
name=self.name,
|
||||||
|
via_device=(DOMAIN, self._bridge_device["serial"]),
|
||||||
|
configuration_url="https://device-login.lutron.com",
|
||||||
|
)
|
||||||
|
area, _ = _area_and_name_from_name(device["name"])
|
||||||
|
if area != UNASSIGNED_AREA:
|
||||||
|
info[ATTR_SUGGESTED_AREA] = area
|
||||||
|
self._attr_device_info = info
|
||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Register callbacks."""
|
"""Register callbacks."""
|
||||||
@ -329,28 +343,7 @@ class LutronCasetaDevice(Entity):
|
|||||||
"""Return the unique ID of the device (serial)."""
|
"""Return the unique ID of the device (serial)."""
|
||||||
return str(self.serial)
|
return str(self.serial)
|
||||||
|
|
||||||
@property
|
|
||||||
def device_info(self) -> DeviceInfo:
|
|
||||||
"""Return the device info."""
|
|
||||||
device = self._device
|
|
||||||
info = DeviceInfo(
|
|
||||||
identifiers={(DOMAIN, self.serial)},
|
|
||||||
manufacturer=MANUFACTURER,
|
|
||||||
model=f"{device['model']} ({device['type']})",
|
|
||||||
name=self.name,
|
|
||||||
via_device=(DOMAIN, self._bridge_device["serial"]),
|
|
||||||
configuration_url="https://device-login.lutron.com",
|
|
||||||
)
|
|
||||||
area, _ = _area_and_name_from_name(device["name"])
|
|
||||||
if area != UNASSIGNED_AREA:
|
|
||||||
info[ATTR_SUGGESTED_AREA] = area
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {"device_id": self.device_id, "zone_id": self._device["zone"]}
|
return {"device_id": self.device_id, "zone_id": self._device["zone"]}
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user