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
aaa1ebee
Commit
aaa1ebee
authored
6 years ago
by
Matt Schmitt
Committed by
Martin Hjelmare
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add support for discrete states to MyQ cover (#16251)
* Add discrete states and update dependency * Add translation dict
parent
18ba50bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/cover/myq.py
+27
-4
27 additions, 4 deletions
homeassistant/components/cover/myq.py
requirements_all.txt
+1
-1
1 addition, 1 deletion
requirements_all.txt
with
28 additions
and
5 deletions
homeassistant/components/cover/myq.py
+
27
−
4
View file @
aaa1ebee
...
...
@@ -8,17 +8,25 @@ import logging
import
voluptuous
as
vol
from
homeassistant.components.cover
import
CoverDevice
from
homeassistant.components.cover
import
(
CoverDevice
,
SUPPORT_CLOSE
,
SUPPORT_OPEN
)
from
homeassistant.const
import
(
CONF_USERNAME
,
CONF_PASSWORD
,
CONF_TYPE
,
STATE_CLOSED
)
CONF_PASSWORD
,
CONF_TYPE
,
CONF_USERNAME
,
STATE_CLOSED
,
STATE_CLOSING
,
STATE_OPENING
)
import
homeassistant.helpers.config_validation
as
cv
REQUIREMENTS
=
[
'
pymyq==0.0.1
1
'
]
REQUIREMENTS
=
[
'
pymyq==0.0.1
5
'
]
_LOGGER
=
logging
.
getLogger
(
__name__
)
DEFAULT_NAME
=
'
myq
'
MYQ_TO_HASS
=
{
'
closed
'
:
STATE_CLOSED
,
'
closing
'
:
STATE_CLOSING
,
'
opening
'
:
STATE_OPENING
}
NOTIFICATION_ID
=
'
myq_notification
'
NOTIFICATION_TITLE
=
'
MyQ Cover Setup
'
...
...
@@ -87,7 +95,17 @@ class MyQDevice(CoverDevice):
@property
def
is_closed
(
self
):
"""
Return true if cover is closed, else False.
"""
return
self
.
_status
==
STATE_CLOSED
return
MYQ_TO_HASS
[
self
.
_status
]
==
STATE_CLOSED
@property
def
is_closing
(
self
):
"""
Return if the cover is closing or not.
"""
return
MYQ_TO_HASS
[
self
.
_status
]
==
STATE_CLOSING
@property
def
is_opening
(
self
):
"""
Return if the cover is opening or not.
"""
return
MYQ_TO_HASS
[
self
.
_status
]
==
STATE_OPENING
def
close_cover
(
self
,
**
kwargs
):
"""
Issue close command to cover.
"""
...
...
@@ -97,6 +115,11 @@ class MyQDevice(CoverDevice):
"""
Issue open command to cover.
"""
self
.
myq
.
open_device
(
self
.
device_id
)
@property
def
supported_features
(
self
):
"""
Flag supported features.
"""
return
SUPPORT_OPEN
|
SUPPORT_CLOSE
def
update
(
self
):
"""
Update status of cover.
"""
self
.
_status
=
self
.
myq
.
get_status
(
self
.
device_id
)
This diff is collapsed.
Click to expand it.
requirements_all.txt
+
1
−
1
View file @
aaa1ebee
...
...
@@ -962,7 +962,7 @@ pymonoprice==0.3
pymusiccast==0.1.6
# homeassistant.components.cover.myq
pymyq==0.0.1
1
pymyq==0.0.1
5
# homeassistant.components.mysensors
pymysensors==0.17.0
...
...
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