Skip to content

Commit

Permalink
2.0.13,区分采暖模式室温控制(自动)还是水温控制(手动)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Hu committed Sep 24, 2024
1 parent 0879097 commit bc8c6f7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions custom_components/airtub_udp/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class AirtubClimateDevice(ClimateEntity):
def __init__(self, hass, name, mode):
"""Initialize the climate device."""
self._enable_turn_on_off_backwards_compatibility = False
self._mode = mode
self._unique_id = name
self.entity_id = f"climate.{name}"
self._name = self._generate_friendly_name()
self._hass = hass
self._mode = mode
self._mode_set = False
self._attr_icon_ch = "mdi:radiator"
self._attr_icon_dhw = "mdi:shower"
Expand All @@ -70,7 +70,9 @@ def __init__(self, hass, name, mode):
def _generate_friendly_name(self):
"""Generate a friendly name."""
if "_ch" in self._unique_id:
return "ch_control"
if self._mode:
return "ch_auto_control"
return "ch_man_control"
return "dhw_control"

@property
Expand Down
2 changes: 1 addition & 1 deletion custom_components/airtub_udp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"issue_tracker": "https://github.com/zenz/airtub_ha_reader/issues",
"requirements": [],
"single_config_entry": true,
"version": "2.0.11"
"version": "2.0.12"
}
9 changes: 6 additions & 3 deletions custom_components/airtub_udp/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@
},
"entity": {
"climate": {
"ch_control": {
"name": "Heating Control"
"ch_auto_control": {
"name": "Heating[Room Temp]"
},
"ch_man_control": {
"name": "Heating[Water Temp]"
},
"dhw_control": {
"name": "Hot Water Control"
"name": "Domestic Hot Water"
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions custom_components/airtub_udp/translations/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@
},
"entity": {
"climate": {
"ch_control": {
"name": "采暖控制"
"ch_auto_control": {
"name": "采暖控制[室温]"
},
"ch_man_control": {
"name": "采暖控制[水温]"
},
"dhw_control": {
"name": "热水控制"
"name": "生活热水控制"
}
}
}
Expand Down

0 comments on commit bc8c6f7

Please sign in to comment.