Skip to content

Commit

Permalink
Daikin adaptions for AirBase units (#23734)
Browse files Browse the repository at this point in the history
* updated list of supported fan_modes

* AirBase units does not support Holiday-mode

* AirBase units does not support outside temp

* pydaikin version bump

* don't modify constant
  • Loading branch information
fredrike authored and MartinHjelmare committed May 13, 2019
1 parent 1a051f0 commit 0ffcc19
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
12 changes: 5 additions & 7 deletions homeassistant/components/daikin/climate.py
Expand Up @@ -81,12 +81,7 @@ def __init__(self, api):
self._api = api
self._list = {
ATTR_OPERATION_MODE: list(HA_STATE_TO_DAIKIN),
ATTR_FAN_MODE: list(
map(
str.title,
appliance.daikin_values(HA_ATTR_TO_DAIKIN[ATTR_FAN_MODE])
)
),
ATTR_FAN_MODE: self._api.device.fan_modes,
ATTR_SWING_MODE: list(
map(
str.title,
Expand All @@ -95,10 +90,13 @@ def __init__(self, api):
),
}

self._supported_features = (SUPPORT_AWAY_MODE | SUPPORT_ON_OFF
self._supported_features = (SUPPORT_ON_OFF
| SUPPORT_OPERATION_MODE
| SUPPORT_TARGET_TEMPERATURE)

if self._api.device.support_away_mode:
self._supported_features |= SUPPORT_AWAY_MODE

if self._api.device.support_fan_mode:
self._supported_features |= SUPPORT_FAN_MODE

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/daikin/manifest.json
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/components/daikin",
"requirements": [
"pydaikin==1.4.0"
"pydaikin==1.4.3"
],
"dependencies": [],
"codeowners": [
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/daikin/sensor.py
Expand Up @@ -26,9 +26,12 @@ async def async_setup_platform(
async def async_setup_entry(hass, entry, async_add_entities):
"""Set up Daikin climate based on config_entry."""
daikin_api = hass.data[DAIKIN_DOMAIN].get(entry.entry_id)
sensors = [ATTR_INSIDE_TEMPERATURE]
if daikin_api.device.support_outside_temperature:
sensors.append(ATTR_OUTSIDE_TEMPERATURE)
async_add_entities([
DaikinClimateSensor(daikin_api, sensor, hass.config.units)
for sensor in SENSOR_TYPES
for sensor in sensors
])


Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -1021,7 +1021,7 @@ pycsspeechtts==1.0.2
# pycups==1.9.73

# homeassistant.components.daikin
pydaikin==1.4.0
pydaikin==1.4.3

# homeassistant.components.danfoss_air
pydanfossair==0.1.0
Expand Down

0 comments on commit 0ffcc19

Please sign in to comment.