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
807d197c
Unverified
Commit
807d197c
authored
2 years ago
by
Mick Vleeshouwer
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add goToAlias button (my position) to Overkiz integration (#76694)
parent
9a6b22a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/overkiz/button.py
+36
-9
36 additions, 9 deletions
homeassistant/components/overkiz/button.py
with
36 additions
and
9 deletions
homeassistant/components/overkiz/button.py
+
36
−
9
View file @
807d197c
"""
Support for Overkiz (virtual) buttons.
"""
"""
Support for Overkiz (virtual) buttons.
"""
from
__future__
import
annotations
from
__future__
import
annotations
from
dataclasses
import
dataclass
from
pyoverkiz.types
import
StateType
as
OverkizStateType
from
homeassistant.components.button
import
ButtonEntity
,
ButtonEntityDescription
from
homeassistant.components.button
import
ButtonEntity
,
ButtonEntityDescription
from
homeassistant.config_entries
import
ConfigEntry
from
homeassistant.config_entries
import
ConfigEntry
from
homeassistant.core
import
HomeAssistant
from
homeassistant.core
import
HomeAssistant
...
@@ -11,41 +15,56 @@ from . import HomeAssistantOverkizData
...
@@ -11,41 +15,56 @@ from . import HomeAssistantOverkizData
from
.const
import
DOMAIN
,
IGNORED_OVERKIZ_DEVICES
from
.const
import
DOMAIN
,
IGNORED_OVERKIZ_DEVICES
from
.entity
import
OverkizDescriptiveEntity
from
.entity
import
OverkizDescriptiveEntity
BUTTON_DESCRIPTIONS
:
list
[
ButtonEntityDescription
]
=
[
@dataclass
class
OverkizButtonDescription
(
ButtonEntityDescription
):
"""
Class to describe an Overkiz button.
"""
press_args
:
OverkizStateType
|
None
=
None
BUTTON_DESCRIPTIONS
:
list
[
OverkizButtonDescription
]
=
[
# My Position (cover, light)
# My Position (cover, light)
Button
Entity
Description
(
Overkiz
ButtonDescription
(
key
=
"
my
"
,
key
=
"
my
"
,
name
=
"
My Position
"
,
name
=
"
My Position
"
,
icon
=
"
mdi:star
"
,
icon
=
"
mdi:star
"
,
),
),
# Identify
# Identify
Button
Entity
Description
(
Overkiz
ButtonDescription
(
key
=
"
identify
"
,
# startIdentify and identify are reversed... Swap this when fixed in API.
key
=
"
identify
"
,
# startIdentify and identify are reversed... Swap this when fixed in API.
name
=
"
Start Identify
"
,
name
=
"
Start Identify
"
,
icon
=
"
mdi:human-greeting-variant
"
,
icon
=
"
mdi:human-greeting-variant
"
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
entity_registry_enabled_default
=
False
,
entity_registry_enabled_default
=
False
,
),
),
Button
Entity
Description
(
Overkiz
ButtonDescription
(
key
=
"
stopIdentify
"
,
key
=
"
stopIdentify
"
,
name
=
"
Stop Identify
"
,
name
=
"
Stop Identify
"
,
icon
=
"
mdi:human-greeting-variant
"
,
icon
=
"
mdi:human-greeting-variant
"
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
entity_registry_enabled_default
=
False
,
entity_registry_enabled_default
=
False
,
),
),
Button
Entity
Description
(
Overkiz
ButtonDescription
(
key
=
"
startIdentify
"
,
# startIdentify and identify are reversed... Swap this when fixed in API.
key
=
"
startIdentify
"
,
# startIdentify and identify are reversed... Swap this when fixed in API.
name
=
"
Identify
"
,
name
=
"
Identify
"
,
icon
=
"
mdi:human-greeting-variant
"
,
icon
=
"
mdi:human-greeting-variant
"
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
entity_category
=
EntityCategory
.
DIAGNOSTIC
,
),
),
# RTDIndoorSiren / RTDOutdoorSiren
# RTDIndoorSiren / RTDOutdoorSiren
Button
Entity
Description
(
key
=
"
dingDong
"
,
name
=
"
Ding Dong
"
,
icon
=
"
mdi:bell-ring
"
),
Overkiz
ButtonDescription
(
key
=
"
dingDong
"
,
name
=
"
Ding Dong
"
,
icon
=
"
mdi:bell-ring
"
),
Button
Entity
Description
(
key
=
"
bip
"
,
name
=
"
Bip
"
,
icon
=
"
mdi:bell-ring
"
),
Overkiz
ButtonDescription
(
key
=
"
bip
"
,
name
=
"
Bip
"
,
icon
=
"
mdi:bell-ring
"
),
Button
Entity
Description
(
Overkiz
ButtonDescription
(
key
=
"
fastBipSequence
"
,
name
=
"
Fast Bip Sequence
"
,
icon
=
"
mdi:bell-ring
"
key
=
"
fastBipSequence
"
,
name
=
"
Fast Bip Sequence
"
,
icon
=
"
mdi:bell-ring
"
),
),
ButtonEntityDescription
(
key
=
"
ring
"
,
name
=
"
Ring
"
,
icon
=
"
mdi:bell-ring
"
),
OverkizButtonDescription
(
key
=
"
ring
"
,
name
=
"
Ring
"
,
icon
=
"
mdi:bell-ring
"
),
# DynamicScreen (ogp:blind) uses goToAlias (id 1: favorite1) instead of 'my'
OverkizButtonDescription
(
key
=
"
goToAlias
"
,
press_args
=
"
1
"
,
name
=
"
My position
"
,
icon
=
"
mdi:star
"
,
),
]
]
SUPPORTED_COMMANDS
=
{
SUPPORTED_COMMANDS
=
{
...
@@ -85,6 +104,14 @@ async def async_setup_entry(
...
@@ -85,6 +104,14 @@ async def async_setup_entry(
class
OverkizButton
(
OverkizDescriptiveEntity
,
ButtonEntity
):
class
OverkizButton
(
OverkizDescriptiveEntity
,
ButtonEntity
):
"""
Representation of an Overkiz Button.
"""
"""
Representation of an Overkiz Button.
"""
entity_description
:
OverkizButtonDescription
async
def
async_press
(
self
)
->
None
:
async
def
async_press
(
self
)
->
None
:
"""
Handle the button press.
"""
"""
Handle the button press.
"""
if
self
.
entity_description
.
press_args
:
await
self
.
executor
.
async_execute_command
(
self
.
entity_description
.
key
,
self
.
entity_description
.
press_args
)
return
await
self
.
executor
.
async_execute_command
(
self
.
entity_description
.
key
)
await
self
.
executor
.
async_execute_command
(
self
.
entity_description
.
key
)
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