Skip to content

Commit c15addc

Browse files
authoredApr 11, 2022
Merge pull request #20 from MTrab/dev
Fixing missing consts
2 parents 77c6013 + 9847af5 commit c15addc

File tree

5 files changed

+89
-7
lines changed

5 files changed

+89
-7
lines changed
 

‎.vscode/launch.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
// Example of attaching to local debug server
7+
"name": "Python: Attach Local",
8+
"type": "python",
9+
"request": "attach",
10+
"port": 5678,
11+
"host": "localhost",
12+
"pathMappings": [
13+
{
14+
"localRoot": "${workspaceFolder}",
15+
"remoteRoot": "."
16+
}
17+
]
18+
},
19+
{
20+
// Example of attaching to my production server
21+
"name": "Python: Attach Remote",
22+
"type": "python",
23+
"request": "attach",
24+
"port": 5678,
25+
"host": "homeassistant.local",
26+
"pathMappings": [
27+
{
28+
"localRoot": "${workspaceFolder}",
29+
"remoteRoot": "/usr/src/homeassistant"
30+
}
31+
]
32+
}
33+
]
34+
}
35+

‎.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"python.linting.pylintEnabled": true,
3+
"python.linting.enabled": true,
4+
"python.pythonPath": "/usr/local/bin/python",
5+
"files.associations": {
6+
"*.yaml": "home-assistant"
7+
}
8+
}

‎.vscode/tasks.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Run Home Assistant on port 9123",
6+
"type": "shell",
7+
"command": "container start",
8+
"problemMatcher": []
9+
},
10+
{
11+
"label": "Run Home Assistant configuration against /config",
12+
"type": "shell",
13+
"command": "container check",
14+
"problemMatcher": []
15+
},
16+
{
17+
"label": "Upgrade Home Assistant to latest dev",
18+
"type": "shell",
19+
"command": "container install",
20+
"problemMatcher": []
21+
},
22+
{
23+
"label": "Install a specific version of Home Assistant",
24+
"type": "shell",
25+
"command": "container set-version",
26+
"problemMatcher": []
27+
}
28+
]
29+
}

‎custom_components/danfoss_ally/climate.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
from .const import (
2222
DATA,
2323
DOMAIN,
24+
HVAC_MODE_MANUAL,
25+
PRESET_MANUAL,
26+
PRESET_PAUSE,
2427
SIGNAL_ALLY_UPDATE_RECEIVED,
2528
)
2629
from .entity import AllyDeviceEntity
2730

2831
# Custom preset for pause mode
29-
PRESET_PAUSE = "pause"
32+
3033

3134
_LOGGER = logging.getLogger(__name__)
3235

@@ -56,7 +59,7 @@ def __init__(
5659
self._unique_id = f"climate_{device_id}_ally"
5760

5861
self._supported_hvac_modes = supported_hvac_modes
59-
self._supported_preset_modes = [PRESET_HOME, PRESET_AWAY, PRESET_PAUSE]
62+
self._supported_preset_modes = [PRESET_HOME, PRESET_AWAY, PRESET_PAUSE, PRESET_MANUAL]
6063
self._support_flags = support_flags
6164

6265
self._available = False
@@ -143,6 +146,8 @@ def preset_mode(self):
143146
return PRESET_AWAY
144147
elif self._device["mode"] == "pause":
145148
return PRESET_PAUSE
149+
elif self._device["mode"] == "manual":
150+
return PRESET_MANUAL
146151

147152
@property
148153
def hvac_modes(self):
@@ -167,6 +172,8 @@ def set_preset_mode(self, preset_mode):
167172
mode = "leaving_home"
168173
elif preset_mode == PRESET_PAUSE:
169174
mode = "pause"
175+
elif preset_mode == PRESET_MANUAL:
176+
mode = "manual"
170177

171178
if mode is None:
172179
return

‎custom_components/danfoss_ally/const.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
HVAC_MODE_OFF,
66
)
77

8-
from pydanfossally.const import ( # pylint: disable=no-name-in-module
9-
THERMOSTAT_MODE_AUTO,
10-
THERMOSTAT_MODE_MANUAL,
11-
THERMOSTAT_MODE_OFF,
12-
)
8+
THERMOSTAT_MODE_AUTO = "hot"
9+
THERMOSTAT_MODE_MANUAL = "manual"
10+
THERMOSTAT_MODE_OFF = "pause"
11+
12+
HVAC_MODE_MANUAL = "manual"
13+
14+
PRESET_MANUAL = "Manual"
15+
PRESET_PAUSE = "Pause"
1316

1417
HA_TO_DANFOSS_HVAC_MODE_MAP = {
1518
HVAC_MODE_OFF: THERMOSTAT_MODE_OFF,

0 commit comments

Comments
 (0)
Please sign in to comment.