Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
03100693
Unverified
Commit
03100693
authored
3 years ago
by
epenet
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use DeviceInfo in syncthing (#58580)
Co-authored-by:
epenet
<
epenet@users.noreply.github.com
>
parent
383a820a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/syncthing/sensor.py
+9
-8
9 additions, 8 deletions
homeassistant/components/syncthing/sensor.py
with
9 additions
and
8 deletions
homeassistant/components/syncthing/sensor.py
+
9
−
8
View file @
03100693
...
...
@@ -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.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment