diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index 3d9e07519a8..823a11542eb 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -38,7 +38,6 @@ from .const import ( CONF_CA_CERTS, CONF_CERTFILE, CONF_KEYFILE, - CONFIG_URL, DOMAIN, LUTRON_CASETA_BUTTON_EVENT, MANUFACTURER, @@ -243,6 +242,7 @@ def _async_subscribe_pico_remote_events( type_ = device["type"] area, name = _area_and_name_from_name(device["name"]) button_number = device["button_number"] + # The original implementation used LIP instead of LEAP # so we need to convert the button number to maintain compat sub_type_to_lip_button = DEVICE_TYPE_SUBTYPE_MAP_TO_LIP[type_] @@ -307,15 +307,13 @@ class LutronCasetaDevice(Entity): self._device = device self._smartbridge = bridge self._bridge_device = bridge_device - if "serial" not in self._device: - return info = DeviceInfo( - identifiers={(DOMAIN, self.serial)}, + identifiers={(DOMAIN, self.unique_id)}, manufacturer=MANUFACTURER, model=f"{device['model']} ({device['type']})", name=self.name, via_device=(DOMAIN, self._bridge_device["serial"]), - configuration_url=CONFIG_URL, + configuration_url="https://device-login.lutron.com", ) area, _ = _area_and_name_from_name(device["name"]) if area != UNASSIGNED_AREA: diff --git a/homeassistant/components/lutron_caseta/binary_sensor.py b/homeassistant/components/lutron_caseta/binary_sensor.py index 352d2213d91..ae6749d57bc 100644 --- a/homeassistant/components/lutron_caseta/binary_sensor.py +++ b/homeassistant/components/lutron_caseta/binary_sensor.py @@ -6,14 +6,12 @@ from homeassistant.components.binary_sensor import ( BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ATTR_SUGGESTED_AREA from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceEntryType -from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from . import DOMAIN as CASETA_DOMAIN, LutronCasetaDevice, _area_and_name_from_name -from .const import BRIDGE_DEVICE, BRIDGE_LEAP, CONFIG_URL, MANUFACTURER, UNASSIGNED_AREA +from . import DOMAIN as CASETA_DOMAIN, LutronCasetaDevice +from .const import BRIDGE_DEVICE, BRIDGE_LEAP async def async_setup_entry( @@ -45,19 +43,7 @@ class LutronOccupancySensor(LutronCasetaDevice, BinarySensorEntity): def __init__(self, device, bridge, bridge_device): """Init an occupancy sensor.""" super().__init__(device, bridge, bridge_device) - info = DeviceInfo( - identifiers={(CASETA_DOMAIN, self.unique_id)}, - manufacturer=MANUFACTURER, - model=f"{device['model']} ({device['type']})", - name=self.name, - via_device=(CASETA_DOMAIN, self._bridge_device["serial"]), - configuration_url=CONFIG_URL, - entry_type=DeviceEntryType.SERVICE, - ) - area, _ = _area_and_name_from_name(device["name"]) - if area != UNASSIGNED_AREA: - info[ATTR_SUGGESTED_AREA] = area - self._attr_device_info = info + self._attr_device_info["entry_type"] = DeviceEntryType.SERVICE @property def device_class(self):