From 12c5aec5e68ccbb6666e586e4bd37de50c939664 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 1 Nov 2023 10:47:56 -0500 Subject: [PATCH] Add bluetooth address to august (#103177) --- homeassistant/components/august/entity.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/august/entity.py b/homeassistant/components/august/entity.py index 47f3b8be74f..d149e035ac4 100644 --- a/homeassistant/components/august/entity.py +++ b/homeassistant/components/august/entity.py @@ -2,10 +2,12 @@ from abc import abstractmethod from yalexs.doorbell import Doorbell -from yalexs.lock import Lock +from yalexs.lock import Lock, LockDetail from yalexs.util import get_configuration_url +from homeassistant.const import ATTR_CONNECTIONS from homeassistant.core import callback +from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity @@ -26,15 +28,18 @@ class AugustEntityMixin(Entity): super().__init__() self._data = data self._device = device + detail = self._detail self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, self._device_id)}, manufacturer=MANUFACTURER, - model=self._detail.model, + model=detail.model, name=device.device_name, - sw_version=self._detail.firmware_version, + sw_version=detail.firmware_version, suggested_area=_remove_device_types(device.device_name, DEVICE_TYPES), configuration_url=get_configuration_url(data.brand), ) + if isinstance(detail, LockDetail) and (mac := detail.mac_address): + self._attr_device_info[ATTR_CONNECTIONS] = {(dr.CONNECTION_BLUETOOTH, mac)} @property def _device_id(self):