Skip to content

Commit

Permalink
🌡 add option "target2current_temp" for climate (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works authored Nov 6, 2023
1 parent 3c46283 commit 61b69eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_miot/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ def temperature_unit(self):

@property
def current_temperature(self):
if self.custom_config('target2current_temp') is True and self.is_on:
return self.target_temperature
if ATTR_CURRENT_TEMPERATURE in self._state_attrs:
return float(self._state_attrs[ATTR_CURRENT_TEMPERATURE] or 0)
if self._prop_temperature:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def get_customize_options(hass, options={}, bool2selects=[], entity_id='', model
})

if domain == 'climate' or re.search(r'aircondition|acpartner|airrtc', model, re.I):
bool2selects.extend(['ignore_fan_switch'])
bool2selects.extend(['ignore_fan_switch', 'target2current_temp'])
options.update({
'bind_sensor': cv.string,
'turn_on_hvac': cv.string,
Expand Down

0 comments on commit 61b69eb

Please sign in to comment.