diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index d0561bc47ab..bb8f94f3abe 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -294,6 +294,8 @@ async def async_unload_entry( class LutronCasetaDevice(Entity): """Common base class for all Lutron Caseta devices.""" + _attr_should_poll = False + def __init__(self, device, bridge, bridge_device): """Set up the base class. @@ -304,6 +306,18 @@ class LutronCasetaDevice(Entity): self._device = device self._smartbridge = bridge 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): """Register callbacks.""" @@ -329,28 +343,7 @@ class LutronCasetaDevice(Entity): """Return the unique ID of the device (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 def extra_state_attributes(self): """Return the state attributes.""" return {"device_id": self.device_id, "zone_id": self._device["zone"]} - - @property - def should_poll(self): - """No polling needed.""" - return False