-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Resolve every enum there is in the xml blobs #105
Conversation
I haven't touched this bit of python from the import of the original project but the logic looks OK. I don't get any new definitions for any of my devices when I run this versus the old code. I don't suppose you could just provide an example of the XML which gets missed just to help document the issue? I did notice that I have a few new definitions from just re-requesting my devices.json as my Dishwasher had an update and the version in the json has gone from 4.0 to 5.1. |
Come to think of it, I guess it would indeed make a lot of sense to collect these zips the login script downloads and build some test cases out of them. There you go Siemens_WQ46B2C40_Dryer.zip The one that prompted this PR was this one which can be found in the Washer zip: <!--BSH.Common.Root.OptionList -->
<optionList access="readWrite" available="true" uid="0106">
<!--BSH.Common.Option.EstimatedTotalProgramTime -->
<option access="read" available="true" initValue="0" min="0" notifyOnChange="true" refCID="10" refDID="82" stepSize="60" uid="0213"/>
<!--LaundryCare.Common.OptionList.ActiveStatus -->
<optionList access="none" available="true" uid="161B">
<!--BSH.Common.Option.ProgramProgress -->
<option access="none" available="false" initValue="0.0" notifyOnChange="true" refCID="11" refDID="A0" stepSize="1.0" uid="021E"/>
<!--BSH.Common.Option.RemainingProgramTime -->
<option access="none" available="true" initValue="0" max="21600" min="0" notifyOnChange="true" refCID="10" refDID="82" stepSize="60" uid="0220"/>
<!--BSH.Common.Option.RemainingProgramTimeIsEstimated -->
<option access="read" available="true" initValue="true" notifyOnChange="true" refCID="01" refDID="00" uid="0225"/>
<!--LaundryCare.Common.Option.ProcessPhase -->
<option access="none" available="false" enumerationType="6A06" initValue="0" max="128" min="0" notifyOnChange="true" refCID="03" refDID="81" uid="6A06"/>
</optionList> Specifically the ProcessPhase |
Awesome, I guess a before and after @pmagyar this didn't break anything for me but I cant find any nested optionLists for any of my appliances so it would be good if someone else could just double check it doesn't break things for them. Other than that I think it's OK to merge? |
@Meatballs1 It stays flat, but it turns from "27138": {
"name": "LaundryCare.Common.Option.LoadRecommendation"
},
"27142": {
"name": "LaundryCare.Common.Option.ProcessPhase"
}, to "27138": {
"name": "LaundryCare.Common.Option.LoadRecommendation",
"access": "none",
"available": "false",
"initValue": "0",
"max": "25500",
"min": "0",
"notifyOnChange": "true",
"refCID": "13",
"refDID": "81",
"stepSize": "100"
},
"27142": {
"name": "LaundryCare.Common.Option.ProcessPhase",
"access": "none",
"available": "false",
"initValue": "0",
"max": "128",
"min": "0",
"notifyOnChange": "true",
"refCID": "03",
"refDID": "81",
"values": {
"0": "NoPhase",
"1": "Prewash",
"2": "IntermediateSpin",
"3": "FillingDetergent",
"4": "DetectingLoad",
[...]
"128": "AnyPhase"
}
}, |
I wish I'd spotted this PR yesterday as I spent the evening debugging the issue myself as I was having similar problems with my Bosch Washer & Dryer. I was just about to submit a PR but then spotted yours - and our code is almost the same. 🤣 |
I've noticed that nested enums did not get resolved correctly by the currently rather hackish XML2JSON parser.
With these changes, they now do, greatly improving the HA experience for my washing machine & dryer:
In the future, it should probably become a real parser that actually understands the format, however for now, I suppose this is good enough