Add device info for Logi Circle camera and sensor entities (#23373)
This commit is contained in:
parent
9d67c9feb6
commit
7a6acca6bb
2 changed files with 29 additions and 2 deletions
|
@ -11,7 +11,7 @@ from homeassistant.const import (
|
|||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .const import (
|
||||
ATTRIBUTION, DOMAIN as LOGI_CIRCLE_DOMAIN, LED_MODE_KEY,
|
||||
ATTRIBUTION, DEVICE_BRAND, DOMAIN as LOGI_CIRCLE_DOMAIN, LED_MODE_KEY,
|
||||
RECORDING_MODE_KEY, SIGNAL_LOGI_CIRCLE_RECONFIGURE,
|
||||
SIGNAL_LOGI_CIRCLE_RECORD, SIGNAL_LOGI_CIRCLE_SNAPSHOT)
|
||||
|
||||
|
@ -98,6 +98,19 @@ class LogiCam(Camera):
|
|||
"""Logi Circle camera's support turning on and off ("soft" switch)."""
|
||||
return SUPPORT_ON_OFF
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return information about the device."""
|
||||
return {
|
||||
'name': self._camera.name,
|
||||
'identifiers': {
|
||||
(LOGI_CIRCLE_DOMAIN, self._camera.id)
|
||||
},
|
||||
'model': self._camera.model_name,
|
||||
'sw_version': self._camera.firmware,
|
||||
'manufacturer': DEVICE_BRAND
|
||||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
|
|
|
@ -9,7 +9,8 @@ from homeassistant.helpers.icon import icon_for_battery_level
|
|||
from homeassistant.util.dt import as_local
|
||||
|
||||
from .const import (
|
||||
ATTRIBUTION, DOMAIN as LOGI_CIRCLE_DOMAIN, LOGI_SENSORS as SENSOR_TYPES)
|
||||
ATTRIBUTION, DEVICE_BRAND, DOMAIN as LOGI_CIRCLE_DOMAIN,
|
||||
LOGI_SENSORS as SENSOR_TYPES)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -66,6 +67,19 @@ class LogiSensor(Entity):
|
|||
"""Return the state of the sensor."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return information about the device."""
|
||||
return {
|
||||
'name': self._camera.name,
|
||||
'identifiers': {
|
||||
(LOGI_CIRCLE_DOMAIN, self._camera.id)
|
||||
},
|
||||
'model': self._camera.model_name,
|
||||
'sw_version': self._camera.firmware,
|
||||
'manufacturer': DEVICE_BRAND
|
||||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
|
|
Loading…
Add table
Reference in a new issue