Use DeviceInfo in syncthing (#58580)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/58607/head
parent
383a820ae1
commit
03100693b0
|
@ -6,6 +6,7 @@ from homeassistant.components.sensor import SensorEntity
|
|||
from homeassistant.core import callback
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
|
||||
from .const import (
|
||||
|
@ -130,15 +131,15 @@ class FolderSensor(SensorEntity):
|
|||
return False
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return device information."""
|
||||
return {
|
||||
"identifiers": {(DOMAIN, self._server_id)},
|
||||
"name": f"Syncthing ({self._syncthing.url})",
|
||||
"manufacturer": "Syncthing Team",
|
||||
"sw_version": self._version,
|
||||
"entry_type": "service",
|
||||
}
|
||||
return DeviceInfo(
|
||||
entry_type="service",
|
||||
identifiers={(DOMAIN, self._server_id)},
|
||||
manufacturer="Syncthing Team",
|
||||
name=f"Syncthing ({self._syncthing.url})",
|
||||
sw_version=self._version,
|
||||
)
|
||||
|
||||
async def async_update_status(self):
|
||||
"""Request folder status and update state."""
|
||||
|
|
Loading…
Reference in New Issue