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
37240e81
Unverified
Commit
37240e81
authored
1 month ago
by
Antonio Larrosa
Committed by
GitHub
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Add melcloud standard horizontal vane modes (#136654)
Co-authored-by:
Joost Lekkerkerker
<
joostlek@outlook.com
>
parent
0b7a023d
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/melcloud/climate.py
+22
-0
22 additions, 0 deletions
homeassistant/components/melcloud/climate.py
with
22 additions
and
0 deletions
homeassistant/components/melcloud/climate.py
+
22
−
0
View file @
37240e81
...
...
@@ -152,6 +152,14 @@ class AtaDeviceClimate(MelCloudClimate):
self
.
_attr_unique_id
=
f
"
{
self
.
api
.
device
.
serial
}
-
{
self
.
api
.
device
.
mac
}
"
self
.
_attr_device_info
=
self
.
api
.
device_info
async
def
async_added_to_hass
(
self
)
->
None
:
"""
When entity is added to hass.
"""
await
super
().
async_added_to_hass
()
# We can only check for vane_horizontal once we fetch the device data from the cloud
if
self
.
_device
.
vane_horizontal
:
self
.
_attr_supported_features
|=
ClimateEntityFeature
.
SWING_HORIZONTAL_MODE
@property
def
extra_state_attributes
(
self
)
->
dict
[
str
,
Any
]
|
None
:
"""
Return the optional state attributes with device specific additions.
"""
...
...
@@ -274,15 +282,29 @@ class AtaDeviceClimate(MelCloudClimate):
"""
Return vertical vane position or mode.
"""
return
self
.
_device
.
vane_vertical
@property
def
swing_horizontal_mode
(
self
)
->
str
|
None
:
"""
Return horizontal vane position or mode.
"""
return
self
.
_device
.
vane_horizontal
async
def
async_set_swing_mode
(
self
,
swing_mode
:
str
)
->
None
:
"""
Set vertical vane position or mode.
"""
await
self
.
async_set_vane_vertical
(
swing_mode
)
async
def
async_set_swing_horizontal_mode
(
self
,
swing_horizontal_mode
:
str
)
->
None
:
"""
Set horizontal vane position or mode.
"""
await
self
.
async_set_vane_horizontal
(
swing_horizontal_mode
)
@property
def
swing_modes
(
self
)
->
list
[
str
]
|
None
:
"""
Return a list of available vertical vane positions and modes.
"""
return
self
.
_device
.
vane_vertical_positions
@property
def
swing_horizontal_modes
(
self
)
->
list
[
str
]
|
None
:
"""
Return a list of available horizontal vane positions and modes.
"""
return
self
.
_device
.
vane_horizontal_positions
async
def
async_turn_on
(
self
)
->
None
:
"""
Turn the entity on.
"""
await
self
.
_device
.
set
({
"
power
"
:
True
})
...
...
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