feat: support the DYD-P40 - #70
Open
Dixiao-L wants to merge 1 commit into
Open
Conversation
Adds the fan-speed value this model reports and a product feature config
for it. Without the enum member, every poll raises:
ValueError: 5 is not a valid DeyeFanSpeed
The enum member alone is not enough: the consumer maps state through
ordered_list_item_to_percentage(feature_config["fan_speed"], ...), which
raises for a speed absent from the product's list, and this product had no
entry at all, so it inherited a default listing speeds 1-4.
Every value below was measured against the appliance -- each property set
and read back, baseline restored afterwards -- because the product
catalogue carries no capability metadata:
modes 1/2/3/4/6 accepted; 0 (MANUAL) and 5 rejected
fan speeds 1/2/3/5 accepted; 4 (FULL) rejected
humidity 40-70 accepted; 20/25/30/35 and 75/80/85/90 rejected
anion NegativeIon settable -> present
oscillating SwingingWind settable -> present
water pump WaterPump 1 reads back 0 -> not present
Note 4 is rejected while 5 is accepted, so 5 is not a step above FULL --
most likely an auto/smart speed. Named UNKNOWN_SPEED following the
existing convention for unidentified values (DeyeDeviceMode already
carries UNKNOWN_MODE and UNKNOWN_MODE_2); rename if you know what it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks today
A DYD-P40 (product id
d71936c6951c11f0a8200242ac480009) reportsWindSpeed = 5, whichDeyeFanSpeeddoesn't define, so every poll raises:The enum member alone isn't enough. Consumers map state through
ordered_list_item_to_percentage(feature_config["fan_speed"], …), which raises for a speed absent from the product's list — and this product has noPRODUCT_FEATURE_CONFIGentry, so it inherits the default listing speeds 1–4.Everything here was measured, not guessed
The product catalogue carries no capability metadata (the P40 entry has only name/brand/picture/config_guide), so I set each property on the real appliance and read it back, capturing a baseline first and restoring it afterwards (zero drift):
ModeWindSpeedSetHumidityNegativeIonSwingingWindWaterPumpSince 4 is rejected while 5 is accepted, 5 is not a step above
FULL— most likely an auto/smart speed. I named itUNKNOWN_SPEED, following the existing convention for unidentified values (DeyeDeviceModealready carriesUNKNOWN_MODEandUNKNOWN_MODE_2). Happy to rename if you know what it is.Two further observations, not addressed here
Recording them since they affect how this model maps, but neither is expressible in a product config:
Fanis read-only on this model and stays1even withPower = 0(CompressorStatusgoes to 0 instead)._parse_state_fogmaps it tofan_running, so that flag is effectively stuck true — which makes the derived "is it running" state wrong.UVis settable on this unit but has no model here.Separate PR against
ha-deye-dehumidifier(#108) fixes an independent issue that had to be cleared before any of this was reachable: the Fog client isn't connected for devices whose platform isn't exactlyFog, and the P40 reportsplatform = 3.