mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Cleanup after removing D-Link yaml (#92739)
This commit is contained in:
parent
e753a33fd7
commit
54b303dfea
@ -1,7 +1,7 @@
|
|||||||
"""Entity representing a D-Link Power Plug device."""
|
"""Entity representing a D-Link Power Plug device."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_CONNECTIONS
|
from homeassistant.const import ATTR_CONNECTIONS
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
|
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
|
||||||
@ -14,6 +14,7 @@ class DLinkEntity(Entity):
|
|||||||
"""Representation of a D-Link Power Plug entity."""
|
"""Representation of a D-Link Power Plug entity."""
|
||||||
|
|
||||||
_attr_attribution = ATTRIBUTION
|
_attr_attribution = ATTRIBUTION
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -24,10 +25,6 @@ class DLinkEntity(Entity):
|
|||||||
"""Initialize a D-Link Power Plug entity."""
|
"""Initialize a D-Link Power Plug entity."""
|
||||||
self.data = data
|
self.data = data
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
if config_entry.source == SOURCE_IMPORT:
|
|
||||||
self._attr_name = config_entry.title
|
|
||||||
else:
|
|
||||||
self._attr_has_entity_name = True
|
|
||||||
self._attr_unique_id = f"{config_entry.entry_id}_{description.key}"
|
self._attr_unique_id = f"{config_entry.entry_id}_{description.key}"
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, config_entry.entry_id)},
|
identifiers={(DOMAIN, config_entry.entry_id)},
|
||||||
|
@ -8,7 +8,7 @@ import pytest
|
|||||||
|
|
||||||
from homeassistant.components import dhcp
|
from homeassistant.components import dhcp
|
||||||
from homeassistant.components.dlink.const import CONF_USE_LEGACY_PROTOCOL, DOMAIN
|
from homeassistant.components.dlink.const import CONF_USE_LEGACY_PROTOCOL, DOMAIN
|
||||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.device_registry import format_mac
|
from homeassistant.helpers.device_registry import format_mac
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
@ -28,8 +28,6 @@ CONF_DHCP_DATA = {
|
|||||||
|
|
||||||
CONF_DATA = CONF_DHCP_DATA | {CONF_HOST: HOST}
|
CONF_DATA = CONF_DHCP_DATA | {CONF_HOST: HOST}
|
||||||
|
|
||||||
CONF_IMPORT_DATA = CONF_DATA | {CONF_NAME: "Smart Plug"}
|
|
||||||
|
|
||||||
CONF_DHCP_FLOW = dhcp.DhcpServiceInfo(
|
CONF_DHCP_FLOW = dhcp.DhcpServiceInfo(
|
||||||
ip=HOST,
|
ip=HOST,
|
||||||
macaddress=MAC,
|
macaddress=MAC,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user