Skip to content

Commit afddc0a

Browse files
committed
Adjustments after merge request
1 parent c091bf8 commit afddc0a

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

components/haier/binary_sensor/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
CONF_INDOOR_FAN_STATUS = "indoor_fan_status"
1616
CONF_FOUR_WAY_VALVE_STATUS = "four_way_valve_status"
1717
CONF_INDOOR_ELECTRIC_HEATING_STATUS = "indoor_electric_heating_status"
18-
CONF_ALARM_ACTIVE = "alarm_active" # Add this line
18+
CONF_ALARM_ACTIVE = "alarm_active"
1919

2020
# Additional icons
2121
ICON_SNOWFLAKE_THERMOMETER = "mdi:snowflake-thermometer"
2222
ICON_HVAC = "mdi:hvac"
2323
ICON_VALVE = "mdi:valve"
24-
ICON_ALARM = "mdi:alarm-light" # Add this line
24+
ICON_ALARM = "mdi:alarm-light"
2525

2626
SENSOR_TYPES = {
2727
CONF_OUTDOOR_FAN_STATUS: binary_sensor.binary_sensor_schema(
@@ -53,7 +53,6 @@
5353
device_class="problem",
5454
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
5555
),
56-
5756
}
5857

5958
CONFIG_SCHEMA = cv.Schema(

components/haier/hon_climate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ void HonClimate::process_alarm_message_(const uint8_t *packet, uint8_t size, boo
831831
}
832832
this->update_sub_text_sensor_(
833833
SubTextSensorType::ACTIVE_ALARMS_TEXT,
834-
alarm_text.empty() ? "No alarm" : alarm_text);
834+
alarm_text.empty() ? "No alarm" : alarm_text.c_str());
835835
}
836836
#endif
837837
#ifdef USE_BINARY_SENSOR
@@ -863,7 +863,7 @@ void HonClimate::process_alarm_message_(const uint8_t *packet, uint8_t size, boo
863863
}
864864
this->update_sub_text_sensor_(
865865
SubTextSensorType::ACTIVE_ALARMS_TEXT,
866-
alarm_text.empty() ? "No alarm" : alarm_text);
866+
alarm_text.empty() ? "No alarm" : alarm_text.c_str());
867867
}
868868
#endif
869869
#ifdef USE_BINARY_SENSOR

components/haier/hon_climate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class HonClimate : public HaierClimateBase {
9393
CLEANING_STATUS = 0,
9494
PROTOCOL_VERSION,
9595
APPLIANCE_NAME,
96-
ACTIVE_ALARMS_TEXT, // <-- ADDED
96+
ACTIVE_ALARMS_TEXT,
9797
SUB_TEXT_SENSOR_TYPE_COUNT,
9898
};
9999
void set_sub_text_sensor(SubTextSensorType type, text_sensor::TextSensor *sens);

docs/esphome-docs/binary_sensor/haier.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Additional sensors for Haier Climate device. **These sensors are supported only
2828
name: Haier Indoor Electric Heating Status
2929
indoor_fan_status:
3030
name: Haier Indoor Fan Status
31+
alarm_active:
32+
name: Haier Alarm Active
3133
outdoor_fan_status:
3234
name: Haier Outdoor Fan Status
3335
@@ -45,6 +47,8 @@ Configuration variables:
4547
All options from :ref:`Binary Sensor <config-binary_sensor>`.
4648
- **indoor_fan_status** (*Optional*): A binary sensor that indicates indoor fan activity.
4749
All options from :ref:`Binary Sensor <config-binary_sensor>`.
50+
- **alarm_active** (*Optional*): A diagnostic binary sensor with the ``problem`` device class indicating whether any alarm is active.
51+
All options from :ref:`Binary Sensor <config-binary_sensor>`.
4852
- **outdoor_fan_status** (*Optional*): A binary sensor that indicates outdoor fan activity.
4953
All options from :ref:`Binary Sensor <config-binary_sensor>`.
5054

docs/esphome-docs/text_sensor/haier.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Additional sensors for Haier Climate device. **These sensors are supported only
1919
name: Haier cleaning status
2020
protocol_version:
2121
name: Haier protocol version
22+
active_alarms_text:
23+
name: Active alarms text
2224
2325
Configuration variables:
2426
------------------------
@@ -30,6 +32,8 @@ Configuration variables:
3032
All options from :ref:`Text Sensor <config-text_sensor>`.
3133
- **protocol_version** (*Optional*): A text sensor that indicates Haier protocol version.
3234
All options from :ref:`Text Sensor <config-text_sensor>`.
35+
- **active_alarms_text** (*Optional*): A diagnostic text sensor that lists all currently active alarms.
36+
All options from :ref:`Text Sensor <config-text_sensor>`.
3337

3438
See Also
3539
--------

0 commit comments

Comments
 (0)