mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Use DeviceInfo in wiffi (#58639)
This commit is contained in:
parent
95f7b0c026
commit
8925f5cc45
@ -14,7 +14,7 @@ from homeassistant.helpers.dispatcher import (
|
|||||||
async_dispatcher_connect,
|
async_dispatcher_connect,
|
||||||
async_dispatcher_send,
|
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.event import async_track_time_interval
|
||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
|
|
||||||
@ -141,16 +141,14 @@ class WiffiEntity(Entity):
|
|||||||
def __init__(self, device, metric, options):
|
def __init__(self, device, metric, options):
|
||||||
"""Initialize the base elements of a wiffi entity."""
|
"""Initialize the base elements of a wiffi entity."""
|
||||||
self._id = generate_unique_id(device, metric)
|
self._id = generate_unique_id(device, metric)
|
||||||
self._device_info = {
|
self._device_info = DeviceInfo(
|
||||||
"connections": {
|
connections={(device_registry.CONNECTION_NETWORK_MAC, device.mac_address)},
|
||||||
(device_registry.CONNECTION_NETWORK_MAC, device.mac_address)
|
identifiers={(DOMAIN, device.mac_address)},
|
||||||
},
|
manufacturer="stall.biz",
|
||||||
"identifiers": {(DOMAIN, device.mac_address)},
|
model=device.moduletype,
|
||||||
"manufacturer": "stall.biz",
|
name=f"{device.moduletype} {device.mac_address}",
|
||||||
"name": f"{device.moduletype} {device.mac_address}",
|
sw_version=device.sw_version,
|
||||||
"model": device.moduletype,
|
)
|
||||||
"sw_version": device.sw_version,
|
|
||||||
}
|
|
||||||
self._name = metric.description
|
self._name = metric.description
|
||||||
self._expiration_date = None
|
self._expiration_date = None
|
||||||
self._value = None
|
self._value = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user