mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Add device info for Logi Circle camera and sensor entities (#23373)
This commit is contained in:
parent
9d67c9feb6
commit
7a6acca6bb
@ -11,7 +11,7 @@ from homeassistant.const import (
|
|||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
|
||||||
from .const import (
|
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,
|
RECORDING_MODE_KEY, SIGNAL_LOGI_CIRCLE_RECONFIGURE,
|
||||||
SIGNAL_LOGI_CIRCLE_RECORD, SIGNAL_LOGI_CIRCLE_SNAPSHOT)
|
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)."""
|
"""Logi Circle camera's support turning on and off ("soft" switch)."""
|
||||||
return SUPPORT_ON_OFF
|
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
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""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 homeassistant.util.dt import as_local
|
||||||
|
|
||||||
from .const import (
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -66,6 +67,19 @@ class LogiSensor(Entity):
|
|||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._state
|
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
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user