diff --git a/custom_components/xiaomi_miot/__init__.py b/custom_components/xiaomi_miot/__init__.py index 9d48a7eb6..176a67d22 100644 --- a/custom_components/xiaomi_miot/__init__.py +++ b/custom_components/xiaomi_miot/__init__.py @@ -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 diff --git a/custom_components/xiaomi_miot/climate.py b/custom_components/xiaomi_miot/climate.py index 48db6fcca..31342a638 100644 --- a/custom_components/xiaomi_miot/climate.py +++ b/custom_components/xiaomi_miot/climate.py @@ -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