Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate geniushub to new climate schema #24191

Merged
merged 67 commits into from
Jul 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a814484
Update one
pvizeli May 14, 2019
f86cd6a
Fix model climate v2
pvizeli May 15, 2019
3cb4ff8
Cleanup p4
pvizeli May 16, 2019
d16dff9
Add comfort hold mode
pvizeli May 16, 2019
ba3d424
Fix old code
pvizeli May 16, 2019
9be6768
Update homeassistant/components/climate/__init__.py
pvizeli May 16, 2019
5c5fc38
Update homeassistant/components/climate/const.py
pvizeli May 16, 2019
deb86e5
First renaming
pvizeli May 16, 2019
1e6e2ec
Rename operation to hvac for paulus
pvizeli May 16, 2019
17ce0ae
Rename hold mode to preset mode
pvizeli May 16, 2019
dbb8aa4
Cleanup & update comments
pvizeli May 17, 2019
f6d77d6
Remove on/off
pvizeli May 17, 2019
0d07e22
Fix supported feature count
pvizeli May 17, 2019
af95d75
Update services
pvizeli May 17, 2019
e0097c1
Update demo
pvizeli May 17, 2019
cfecfbd
Fix tests & use current_hvac
pvizeli May 20, 2019
d2bcee3
Update comment
pvizeli May 20, 2019
72fa8b9
Fix tests & add typing
pvizeli May 20, 2019
3d1917b
Add more typing
pvizeli May 20, 2019
e921252
Update modes
pvizeli May 20, 2019
151a6c4
Fix tests
pvizeli May 20, 2019
fb85e9a
Cleanup low/high with range
pvizeli May 20, 2019
d964eab
Update homematic part 1
pvizeli May 20, 2019
1fdf810
Finish homematic
pvizeli May 20, 2019
e52a1bc
Fix lint
pvizeli May 21, 2019
9ccd1e8
fix hm mapping
pvizeli May 21, 2019
41376cd
Support simple devices
pvizeli May 21, 2019
8a091d5
convert lcn
pvizeli May 22, 2019
1e8d74f
migrate oem
pvizeli May 22, 2019
fe7794a
Fix xs1
pvizeli May 22, 2019
32efc21
update hive
pvizeli May 22, 2019
e241f56
update mil
pvizeli May 22, 2019
0d20645
Update toon
pvizeli May 22, 2019
772b07e
migrate deconz
pvizeli May 22, 2019
88bcce1
cleanup
pvizeli May 22, 2019
1083cd7
update tesla
pvizeli May 22, 2019
110ca3d
Fix lint
pvizeli May 23, 2019
dfe8902
Fix vera
pvizeli May 23, 2019
b92ec04
Migrate zwave
pvizeli May 23, 2019
84c98a0
Migrate velbus
pvizeli May 23, 2019
9af2fd1
Cleanup humity feature
pvizeli May 23, 2019
a8d538b
Cleanup
pvizeli May 24, 2019
4b1495f
Migrate wink
pvizeli May 24, 2019
6aacd16
migrate dyson
pvizeli May 27, 2019
9c546b7
Fix current hvac
pvizeli May 27, 2019
2bdfa0b
Renaming
pvizeli May 27, 2019
65d183a
Fix lint
pvizeli May 27, 2019
eb049b2
Migrate tfiac
pvizeli May 27, 2019
abfd323
migrate tado
pvizeli May 29, 2019
fec87c5
delinted
zxdavb May 29, 2019
64929c8
use latest client
zxdavb May 29, 2019
1b72af5
clean up mappings
zxdavb May 29, 2019
798350b
add duration to set_temperature
zxdavb May 30, 2019
110d80f
delinted
zxdavb May 29, 2019
22de487
clean up mappings
zxdavb May 29, 2019
fe38786
add duration to set_temperature
zxdavb May 30, 2019
97e6b61
manual rebase
zxdavb Jul 2, 2019
7913210
tweak
zxdavb Jul 2, 2019
2f6bfb9
fix regression
zxdavb Jul 2, 2019
f3210eb
small fix
zxdavb Jul 2, 2019
3f45d98
fix rebase mixup
zxdavb Jul 2, 2019
fa0c916
address comments
zxdavb Jul 3, 2019
64e884c
finish refactor
zxdavb Jul 3, 2019
3c499b8
fix regression
zxdavb Jul 3, 2019
dbd20d7
tweak type hints
zxdavb Jul 3, 2019
c609600
delint
zxdavb Jul 3, 2019
f0f1b9e
manual rebase
zxdavb Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up mappings
  • Loading branch information
zxdavb committed Jul 4, 2019
commit 22de487d70598ee72db169a0828969cac52d36ce
20 changes: 7 additions & 13 deletions homeassistant/components/geniushub/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
'linked': None,
'other': None,
}
HA_PRESET_TO_GH_MODE = {v: k for k, v in GH_MODE_TO_HA_PRESET
HA_PRESET_TO_GH_MODE = {v: k for k, v in GH_MODE_TO_HA_PRESET.items()
if k is not None}

HA_HVAC_MODE_TO_GH_MODE = {
HVAC_MODE_OFF: 'off',
HVAC_MODE_AUTO: None,
HVAC_MODE_AUTO: 'timer',
}
GH_MODE_TO_HA_PRESET = {v: k for k, v in HA_HVAC_MODE_TO_GH_MODE
if k is not None}
GH_MODE_TO_HA_HVAC_MODE = {v: k for k, v in HA_HVAC_MODE_TO_GH_MODE.items()}


async def async_setup_platform(hass, hass_config, async_add_entities,
Expand All @@ -60,13 +59,6 @@ def __init__(self, client, zone):
self._client = client
self._zone = zone

self._hvac_mode_list = list(HA_HVAC_MODE_TO_GH_MODE)
# Only some zones have movement detectors, which allow Footprint mode
if hasattr(self._zone, 'occupied'):
self._preset_list = [PRESET_ECO, PRESET_BOOST]
else:
self._preset_list = [PRESET_BOOST]

async def async_added_to_hass(self) -> None:
"""Run when entity about to be added."""
async_dispatcher_connect(self.hass, DOMAIN, self._refresh)
Expand Down Expand Up @@ -132,7 +124,7 @@ def hvac_mode(self) -> str:

Need to be one of HVAC_MODE_*.
"""
return GH_MODE_TO_HA_PRESET.get(self._zone.mode)
return GH_MODE_TO_HA_HVAC_MODE.get(self._zone.mode, HVAC_MODE_AUTO)

@property
def hvac_modes(self) -> List[str]:
Expand All @@ -150,7 +142,9 @@ def preset_mode(self) -> Optional[str]:
@property
def preset_modes(self) -> Optional[List[str]]:
"""Return a list of available preset modes."""
return self._preset_list
if hasattr(self._zone, 'occupied'): # has a movement sensor
return list(HA_PRESET_TO_GH_MODE)
return [PRESET_BOOST]

async def async_set_temperature(self, **kwargs) -> None:
"""Set a new target temperature for this zone."""
Expand Down