Commit graph

44 commits

Author SHA1 Message Date
Niek e3205e4255
Add defrost status binary sensor for AC appliances (#15)
Add a new binary sensor to monitor the defrost status of air conditioning
units. The sensor uses the 'defrostStatus' key and displays when the AC
is in defrost mode with a snowflake-melt icon.
2025-12-16 17:37:55 +01:00
danyrd92 e01d19efd6
Add Preheat Binary Sensor for Ovens + Fix Attribute Handling for Binary Sensors (#17)
This PR introduces a new binary sensor for Haier ovens based on the preheatStatus attribute. While implementing this feature, I discovered that the integration does not correctly evaluate certain appliance attributes, which caused binary sensors to always report off even when the underlying value indicated they should be on.

Issue Identified

Attributes such as preheatStatus and onOffStatus are not returned as raw integers. Instead, the integration receives them as HonAttribute objects. Because the existing logic compares the object itself directly against the expected value, the expression value == on_value always evaluates to False.

Fix Implemented

To ensure proper evaluation, the binary sensor logic has been updated so that when an attribute is a HonAttribute instance, the sensor extracts its actual value using:

value = attr.value if hasattr(attr, "value") else attr


This fix has been applied to both:

is_on()

_handle_coordinator_update()

As a result, the newly added preheatStatus sensor works correctly, and the previously existing onOffStatus binary sensor now functions reliably as well.

Potential Impact on Other Sensors

This change may also correct the behavior of other binary sensors that rely on attributes following the same pattern. I cannot verify all of them because I only have access to a single Haier oven, but the patch is safe, backward-compatible, and should improve the accuracy of any affected entities.
2025-12-16 17:37:03 +01:00
Michał Małolepszy 0823793977 Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
Michał Małolepszy 7a5db6ec6f Fix HomeAssistantType deprecation warning 2025-06-26 00:59:54 +02:00
Andre Basche a6c2c3e992 Rebuild to single data coordinator 2024-03-29 01:22:44 +01:00
Andre Basche c46171114f Change poll to push 2024-03-25 02:26:20 +01:00
Andre Basche 6e8576c7bd Add FRE appliances, #177 2024-03-17 23:54:50 +01:00
Andre Basche f007777689 Fix mypy checks 2024-01-11 00:41:49 +01:00
Andre Basche 9d6b8297b2 Add mypy check, add missing types and fix type issues 2023-07-23 21:53:00 +02:00
Andre Basche f0fb5742a4 Add compatibility for more fridge models #93 2023-07-19 23:57:33 +02:00
Andre Basche c0d25a4efe Fix some small bugs 2023-07-10 00:21:45 +02:00
Andre Basche 2e056aa8d6 Update icons/translations 2023-07-10 00:19:43 +02:00
Andre Basche 0d43eeff3d Merge branch 'main' into refactor 2023-06-22 13:18:45 +02:00
Andre Basche 78727e89cd Add entites for air purifier #72 2023-06-21 00:59:42 +02:00
Andre Basche 1ea9153c2e Apply changes for new pyhon version 2023-06-13 00:14:51 +02:00
Andre Basche 80b3741f2f Reduce lagging update 2023-06-08 20:01:55 +02:00
Andre Basche a8762367ed Refactor hon entities 2023-05-28 00:30:40 +02:00
Andre Basche 696dc136eb Refactor entry setup 2023-05-25 01:30:33 +02:00
Andre Basche e9d1bb2056 Refactor get coordinator 2023-05-25 00:52:54 +02:00
Andre Basche d963086dbf Fix climate not available #52 2023-05-19 01:27:44 +02:00
Andre Basche a4ec3290ba Many air conditioner fixes for #52 2023-05-17 00:01:33 +02:00
Andre Basche 81676771c7 Add some fridge sensors, change some configs to controls 2023-05-15 19:27:41 +02:00
Andre Basche 604cf1b3c6 Add more fridge sensor #41 2023-05-15 00:38:41 +02:00
Andre Basche 146e710881 Add first fridge sensors #41 2023-05-10 18:23:06 +02:00
Andre Basche 6935f5f07f Deactivate contols when remotectrl disabled, fixes #28 2023-05-07 19:13:50 +02:00
Andre Basche 155b1ff91a Add all wm and td sensors to wd 2023-05-07 16:39:45 +02:00
Andre Basche 0e9bd97c7b Remove useless warning, bump version 2023-05-07 13:53:05 +02:00
Andre Basche c0fda4cd1b Add more control for hoover washing machine #34 2023-05-07 02:10:30 +02:00
Andre Basche 5bff5d2143 Add more translation keys 2023-04-24 21:38:05 +02:00
Andre Basche c60d94a170 Improve translations and sensors for td and wm 2023-04-23 16:30:57 +02:00
Andre Basche 90e02428e8 start translation of entity names 2023-04-23 03:31:32 +02:00
Andre Basche a2d0257410 Add more sensors for #22 2023-04-18 23:50:14 +02:00
Andre Basche 5f9dbef4fc Add dishwasher #21 2023-04-16 21:55:47 +02:00
Andre Basche 2aa1d3df01 Correct name for IH #22 2023-04-16 13:56:58 +02:00
Andre Basche d91b3edb40 Use unique_id instead of mac address for #22 2023-04-15 22:05:02 +02:00
Andre Basche 83c5e3479e Add hob support #22 2023-04-15 04:34:12 +02:00
Andre Basche 907bc44533 Reformat with black 2023-04-10 19:51:16 +02:00
Andre Basche 7e9202ef38 New pyhOn version 2023-04-10 07:09:54 +02:00
Andre Basche 6093b57f76 Merge branch 'main' into oven 2023-04-08 04:44:47 +02:00
Miguel Ángel 116f9d5470 Add oven support 2023-04-07 13:52:55 +02:00
Andre Basche 077bded6dd Improve washing machine sensors 2023-04-02 02:44:13 +02:00
drudgebg 196309ef5f
Update binary_sensor.py 2023-03-21 14:05:03 +02:00
Andre Basche 075d34b5e2 Fix many bugs 2023-03-08 23:00:55 +01:00
Andre Basche 03a1e40b6e Rename repo 2023-03-06 13:41:58 +01:00
Renamed from custom_components/haier/binary_sensor.py (Browse further)