Comments (7)
Done! Just published v1.4.0.
from wideq.
Thanks! The culprit is here:
"Operation": {
"_comment": "운전On/Off",
"type": "Enum",
"default": "0",
"option": {
"0": "@AC_MAIN_OPERATION_OFF_W",
"1": "@AC_MAIN_OPERATION_RIGHT_ON_W"
}
},
Namely, the "on" state for your model is @AC_MAIN_OPERATION_RIGHT_ON_W
. This used to be what we used for "on," but #57 changed the "on/off" states to have separate states for left, right, and both:
Lines 113 to 116 in 919139d
…which apparently is the right thing to do for some models but not yours.
I'm not sure exactly what to do here. I guess we need to query what type of model it is at setup and adjust the "on" state accordingly? That is, when we create the ACDevice
object, it should check whether its Operation
option supports @AC_MAIN_OPERATION_ALL_ON_W
and, if so, switches the enum value for turning the device on from RIGHT_ON
to ALL_ON
.
Every time I interact with this LG API, we find another messy mistake…
from wideq.
Well, fortunately we wouldn't have to literally hardcode a model->behavior mapping. We could just look in the model information dictionary to check which modes it supports. So at least it would generalize to similar models that have (or don't have) the left & right modes.
In the end, I think you end up sending the number (0 or 1). But we use the string key to avoid hard-coding the specific number for each option.
from wideq.
Got it; thanks! I think the most useful thing here might be the device details from the JSON file that example.py creates. Can you remove your tokens from that file (which are authentication credentials and shouldn't be shared) and include it?
from wideq.
Attached. Wow that's a lot of stuff... If you need help let me know.
wideq_state.zip
from wideq.
What a PITA.
I like your idea but I am afraid you would perpetually keep adding new mess :) This would require keeping a dictionary of models and their commands. These are pretty volatile going forward?
I would catch exception and try another command until it does not throw exception. This is "programming by exception" which is anti-pattern but their mess will propagate and can only be defended against if you introduce "anti-corruption" layer which I am not convinced is worth your time.
Another idea would be to specify in configuration (somehow) which one to use (or model supports it) e.g. All, Left, Right? Let consumer pick the one that works.
What does 0 and 1 mean here? Not sure how their API works if you have to send @ command or could you just send numerical command?
"0": "@AC_MAIN_OPERATION_OFF_W",
"1": "@AC_MAIN_OPERATION_RIGHT_ON_W"
from wideq.
Thanks for merging my patch for this - I’d love to get a fresh release out with the fix included soon 😄
from wideq.
Related Issues (20)
- dehumidifier is not shown HOT 1
- Can't make it run HOT 1
- Invalid Config for sensor
- Add support for AC filter reset HOT 1
- wideq.core.InvalidRequestError: (9000, '잘못된 요청')
- Wonder how this is communicating with thinq appliance HOT 2
- Page Not Found Error HOT 1
- Add support for Silent Function in AC.py
- Add power consumption to "mon"
- API V2 functional? HOT 1
- Only 1 of 2 linked devices found
- Google Login
- How figure out before buy if device is supported (ie v1 or v2) HOT 3
- V2 HOT 4
- Is impossible the support to LG V2 Api AC? HOT 3
- Dokumentation HOT 1
- no attribute 'get_device_obj' HOT 1
- AC Device Snapshots Outdated
- Can not reset AC filter life
- set-temp has no effect on AC RAC_056905_AT
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wideq.