Use DeviceInfo in wiffi (#58639)
parent
95f7b0c026
commit
8925f5cc45
|
@ -14,7 +14,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.util.dt import utcnow
|
||||
|
||||
|
@ -141,16 +141,14 @@ class WiffiEntity(Entity):
|
|||
def __init__(self, device, metric, options):
|
||||
"""Initialize the base elements of a wiffi entity."""
|
||||
self._id = generate_unique_id(device, metric)
|
||||
self._device_info = {
|
||||
"connections": {
|
||||
(device_registry.CONNECTION_NETWORK_MAC, device.mac_address)
|
||||
},
|
||||
"identifiers": {(DOMAIN, device.mac_address)},
|
||||
"manufacturer": "stall.biz",
|
||||
"name": f"{device.moduletype} {device.mac_address}",
|
||||
"model": device.moduletype,
|
||||
"sw_version": device.sw_version,
|
||||
}
|
||||
self._device_info = DeviceInfo(
|
||||
connections={(device_registry.CONNECTION_NETWORK_MAC, device.mac_address)},
|
||||
identifiers={(DOMAIN, device.mac_address)},
|
||||
manufacturer="stall.biz",
|
||||
model=device.moduletype,
|
||||
name=f"{device.moduletype} {device.mac_address}",
|
||||
sw_version=device.sw_version,
|
||||
)
|
||||
self._name = metric.description
|
||||
self._expiration_date = None
|
||||
self._value = None
|
||||
|
|
Loading…
Reference in New Issue