Use DeviceInfo in syncthing (#58580)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58607/head
epenet 2021-10-28 14:30:02 +02:00 committed by GitHub
parent 383a820ae1
commit 03100693b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -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."""