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
107bd11a
Unverified
Commit
107bd11a
authored
3 years ago
by
epenet
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use DeviceInfo in wemo (#58638)
parent
37930aee
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/wemo/light.py
+9
-8
9 additions, 8 deletions
homeassistant/components/wemo/light.py
homeassistant/components/wemo/wemo_device.py
+8
-7
8 additions, 7 deletions
homeassistant/components/wemo/wemo_device.py
with
17 additions
and
15 deletions
homeassistant/components/wemo/light.py
+
9
−
8
View file @
107bd11a
...
...
@@ -17,6 +17,7 @@ from homeassistant.components.light import (
from
homeassistant.core
import
callback
from
homeassistant.helpers.device_registry
import
CONNECTION_ZIGBEE
from
homeassistant.helpers.dispatcher
import
async_dispatcher_connect
from
homeassistant.helpers.entity
import
DeviceInfo
import
homeassistant.util.color
as
color_util
from
.const
import
DOMAIN
as
WEMO_DOMAIN
...
...
@@ -99,15 +100,15 @@ class WemoLight(WemoEntity, LightEntity):
return
self
.
light
.
uniqueID
@property
def
device_info
(
self
):
def
device_info
(
self
)
->
DeviceInfo
:
"""
Return the device info.
"""
return
{
"
name
"
:
self
.
name
,
"
connections
"
:
{(
CONNECTION_ZIGBEE
,
self
.
_unique_id
)},
"
identifiers
"
:
{(
WEMO_DOMAIN
,
self
.
_unique_id
)}
,
"
model
"
:
self
.
_model_name
,
"
manufacturer
"
:
"
Belkin
"
,
}
return
DeviceInfo
(
connections
=
{(
CONNECTION_ZIGBEE
,
self
.
_unique_id
)}
,
identifiers
=
{(
WEMO_DOMAIN
,
self
.
_unique_id
)},
manufacturer
=
"
Belkin
"
,
model
=
self
.
_model_name
,
name
=
self
.
name
,
)
@property
def
brightness
(
self
):
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/wemo/wemo_device.py
+
8
−
7
View file @
107bd11a
...
...
@@ -17,6 +17,7 @@ from homeassistant.const import (
)
from
homeassistant.core
import
HomeAssistant
,
callback
from
homeassistant.helpers.device_registry
import
async_get
as
async_get_device_registry
from
homeassistant.helpers.entity
import
DeviceInfo
from
homeassistant.helpers.update_coordinator
import
DataUpdateCoordinator
,
UpdateFailed
from
.const
import
DOMAIN
,
WEMO_SUBSCRIPTION_EVENT
...
...
@@ -120,13 +121,13 @@ class DeviceCoordinator(DataUpdateCoordinator):
raise
UpdateFailed
(
"
WeMo update failed
"
)
from
err
def
_device_info
(
wemo
:
WeMoDevice
):
return
{
"
name
"
:
wemo
.
name
,
"
identifiers
"
:
{(
DOMAIN
,
wemo
.
serialnumber
)}
,
"
model
"
:
wemo
.
model_name
,
"
manufacturer
"
:
"
Belkin
"
,
}
def
_device_info
(
wemo
:
WeMoDevice
)
->
DeviceInfo
:
return
DeviceInfo
(
identifiers
=
{(
DOMAIN
,
wemo
.
serialnumber
)}
,
manufacturer
=
"
Belkin
"
,
model
=
wemo
.
model_name
,
name
=
wemo
.
name
,
)
async
def
async_register_device
(
...
...
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