Bug description
The integration uses the current AntiDirectBlow value to infer whether the device supports the feature. For a device that supports the feature but currently has it turned off, the local status query returns 0. The detection code treats this as false and sets _has_anti_direct_blow = False, so the switch becomes unavailable after setup/reload.
Turning the feature on in Gree+ makes the query return 1; after reloading the integration, the same switch is detected and becomes available.
Reproduction
- Use a Gree AC that supports Anti Direct Blow and add it through the config flow.
- Turn Anti Direct Blow off in the Gree+ app.
- Reload the Gree integration (or restart Home Assistant).
- Observe that the
Anti Direct Blow switch is unavailable.
- Turn the feature on in Gree+, then reload the integration.
- The switch becomes available and the local status contains
AntiDirectBlow=1.
Actual behavior
GreeGetValues(["AntiDirectBlow"]) returns the scalar 0 when the feature is supported but off. In custom_components/gree/climate.py, the current truthiness test therefore takes the else branch:
if anti_direct_blow:
self._has_anti_direct_blow = True
else:
self._has_anti_direct_blow = False
This conflates a supported capability with its current disabled state.
Expected behavior
The entity should remain available for a supported device regardless of whether its current value is 0 or 1. A successful reply should be distinguished from an unsupported/missing field.
A possible direction is to test for a returned value rather than truthiness, e.g. anti_direct_blow is not None (while retaining appropriate handling for a missing/unsupported field).
Environment
- Home Assistant Core: 2026.8.1
- Integration: Gree A/C 3.6.0
- Device: Gree KFR-35GW/NhHf1BAj
- Device firmware: V1.14
- Local connection: UDP/7000, direct IP configuration
Related historical report: #182
Bug description
The integration uses the current
AntiDirectBlowvalue to infer whether the device supports the feature. For a device that supports the feature but currently has it turned off, the local status query returns0. The detection code treats this as false and sets_has_anti_direct_blow = False, so the switch becomes unavailable after setup/reload.Turning the feature on in Gree+ makes the query return
1; after reloading the integration, the same switch is detected and becomes available.Reproduction
Anti Direct Blowswitch is unavailable.AntiDirectBlow=1.Actual behavior
GreeGetValues(["AntiDirectBlow"])returns the scalar0when the feature is supported but off. Incustom_components/gree/climate.py, the current truthiness test therefore takes theelsebranch:This conflates a supported capability with its current disabled state.
Expected behavior
The entity should remain available for a supported device regardless of whether its current value is
0or1. A successful reply should be distinguished from an unsupported/missing field.A possible direction is to test for a returned value rather than truthiness, e.g.
anti_direct_blow is not None(while retaining appropriate handling for a missing/unsupported field).Environment
Related historical report: #182