Skip to content

Commit

Permalink
Fixes and improvements for NeoStatHC
Browse files Browse the repository at this point in the history
  • Loading branch information
ocrease committed Jan 23, 2025
1 parent 3504e90 commit 1fecfb3
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/heatmiserneo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def target_temperature_high(self):
def target_temperature_low(self):
"""Return the temperature we try to reach."""
target = float(self.data.target_temperature)
if self.hvac_action() != HVACAction.OFF and target < 255:
if self.hvac_action != HVACAction.OFF and target < 255:
return target
return None

Expand Down
2 changes: 2 additions & 0 deletions custom_components/heatmiserneo/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
FAN_OFF,
UnitOfTemperature,
)

Expand Down Expand Up @@ -155,6 +156,7 @@ class ModeSelectOption(str, enum.Enum):
"Medium": FAN_MEDIUM,
"Low": FAN_LOW,
"Auto": FAN_AUTO,
"Off": FAN_OFF,
}


Expand Down
12 changes: 12 additions & 0 deletions custom_components/heatmiserneo/icons.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"entity": {
"sensor": {
"fan_speed": {
"default": "mdi:fan",
"state": {
"auto": "mdi:fan-auto",
"off": "mdi:fan-off",
"low": "mdi:fan-speed-1",
"medium": "mdi:fan-speed-2",
"high": "mdi:fan-speed-3"
}
}
},
"select": {
"switching_differential": {
"default": "mdi:thermometer"
Expand Down
8 changes: 5 additions & 3 deletions custom_components/heatmiserneo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,11 @@ class HeatmiserNeoHubSensorEntityDescription(
key="heatmiser_neo_stat_hc_fan_speed",
device_class=SensorDeviceClass.ENUM,
options=[FAN_OFF, FAN_HIGH, FAN_MEDIUM, FAN_LOW, FAN_AUTO],
name="Fan Speed",
value_fn=lambda device: HEATMISER_FAN_SPEED_HA_FAN_MODE.get(
device.data.fan_speed
translation_key="fan_speed",
value_fn=lambda device: (
FAN_AUTO
if device.data.fan_control != "Manual"
else HEATMISER_FAN_SPEED_HA_FAN_MODE.get(device.data.fan_speed, FAN_OFF)
),
setup_filter_fn=lambda device, _: (
device.device_type in HEATMISER_TYPE_IDS_HC and not device.time_clock_mode
Expand Down
10 changes: 10 additions & 0 deletions custom_components/heatmiserneo/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@
}
},
"sensor": {
"fan_speed": {
"name": "Fan Speed",
"state": {
"auto": "Auto",
"off": "Off",
"low": "Low",
"medium": "Medium",
"high": "High"
}
},
"hub_profile_format": {
"name": "Profile Format",
"state": {
Expand Down
10 changes: 10 additions & 0 deletions custom_components/heatmiserneo/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@
}
},
"sensor": {
"fan_speed": {
"name": "Fan Speed",
"state": {
"auto": "Auto",
"off": "Off",
"low": "Low",
"medium": "Medium",
"high": "High"
}
},
"hub_profile_format": {
"name": "Profile Format",
"state": {
Expand Down

0 comments on commit 1fecfb3

Please sign in to comment.