Skip to content

Commit

Permalink
♻️ improve for climate (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed May 14, 2021
1 parent 60cab80 commit 40a66cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def async_setup_xiaomi_cloud(hass: hass_core.HomeAssistant, config_entry:
CONF_CONFIG_VERSION: entry.get(CONF_CONFIG_VERSION) or 0,
}
config['configs'].append(cfg)
_LOGGER.debug('Xiaomi cloud device: %s', {**cfg, CONF_TOKEN: ''})
_LOGGER.debug('Xiaomi cloud device: %s', {**cfg, CONF_TOKEN: '****'})
hass.data[DOMAIN][entry_id] = config
return True

Expand Down
4 changes: 2 additions & 2 deletions custom_components/xiaomi_miot/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def preset_mode(self):
return HVAC_MODE_OFF
if self._preset_modes and self._prop_mode:
acm = self._prop_mode.from_dict(self._state_attrs)
acm = -1 if acm is None else int(acm or 0)
return self._preset_modes.get(acm, HVAC_MODE_OFF)
acm = -1 if acm is None else acm
return self._preset_modes.get(acm)
return None

@property
Expand Down

0 comments on commit 40a66cc

Please sign in to comment.