Add smartthings configuration_url (#58676)
parent
cd988bded0
commit
85aeee7cc7
|
@ -21,7 +21,7 @@ from homeassistant.helpers.dispatcher import (
|
|||
async_dispatcher_connect,
|
||||
async_dispatcher_send,
|
||||
)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
|
@ -428,14 +428,15 @@ class SmartThingsEntity(Entity):
|
|||
self._dispatcher_remove()
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Get attributes about the device."""
|
||||
return {
|
||||
"identifiers": {(DOMAIN, self._device.device_id)},
|
||||
"name": self._device.label,
|
||||
"model": self._device.device_type_name,
|
||||
"manufacturer": "Unavailable",
|
||||
}
|
||||
return DeviceInfo(
|
||||
configuration_url="https://account.smartthings.com",
|
||||
identifiers={(DOMAIN, self._device.device_id)},
|
||||
manufacturer="Unavailable",
|
||||
model=self._device.device_type_name,
|
||||
name=self._device.label,
|
||||
)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
|
|
@ -65,6 +65,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
assert entry.unique_id == f"{device.device_id}.{Attribute.motion}"
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -579,6 +579,8 @@ async def test_entity_and_device_attributes(hass, thermostat):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, thermostat.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, thermostat.device_id)}
|
||||
assert entry.name == thermostat.label
|
||||
assert entry.model == thermostat.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -44,6 +44,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -70,6 +70,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -123,6 +123,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -32,6 +32,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -98,6 +98,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
assert entry.entity_category == ENTITY_CATEGORY_DIAGNOSTIC
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
@ -125,6 +127,8 @@ async def test_energy_sensors_for_switch_device(hass, device_factory):
|
|||
assert entry.entity_category is None
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
@ -138,6 +142,8 @@ async def test_energy_sensors_for_switch_device(hass, device_factory):
|
|||
assert entry.entity_category is None
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
@ -175,6 +181,8 @@ async def test_power_consumption_sensor(hass, device_factory):
|
|||
assert entry.unique_id == f"{device.device_id}.energy_meter"
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
@ -187,6 +195,8 @@ async def test_power_consumption_sensor(hass, device_factory):
|
|||
assert entry.unique_id == f"{device.device_id}.power_meter"
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
@ -209,6 +219,8 @@ async def test_power_consumption_sensor(hass, device_factory):
|
|||
assert entry.unique_id == f"{device.device_id}.energy_meter"
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
|
@ -31,6 +31,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
|
|||
|
||||
entry = device_registry.async_get_device({(DOMAIN, device.device_id)})
|
||||
assert entry
|
||||
assert entry.configuration_url == "https://account.smartthings.com"
|
||||
assert entry.identifiers == {(DOMAIN, device.device_id)}
|
||||
assert entry.name == device.label
|
||||
assert entry.model == device.device_type_name
|
||||
assert entry.manufacturer == "Unavailable"
|
||||
|
|
Loading…
Reference in New Issue