Open klimofey opened 1 week ago
Hello, thank you for PR. I would like to understand what is the use case you are proposing to implement. If I understand your changes correctly, you are proposing changes to implement very specific Electra IR remote control. It seems, that it differs a lot from how currently supported AC units works.
Could you please describe in detail how Electra IR works and what is the use case behind your PR?
P.S.: I am not too much in favor of implementing features used only on specific type of AC units. This would be nightmare to maintain in longer term. Also I am currently working on preset modes support and most of the changes are exactly at the same place like your PR.
@litinoveweedle
Hi, yes, of course I will describe the changes
I solved several issues.
Thank you for an explanation.
@litinoveweedle
But for the air conditioner to accept this command, it must first be turned on. If I add "on" next to the "off" command, it is sent every time the temperature changes. It turns off my air conditioner if it was on and vice versa.
That's why I added commands to turn it on from the off mode and switch the air conditioner already in the on mode. At the same time, I left the option of simply specifying the code in the temperature, and not the dictionary
So let me rephrase your issue. Your device has same command for "on" and "off", therefore if defined as 'on' command it will cause AC to switch off, if already on. The problem here is, that this whole integration only assume states of the device, and therefore to be sure 'on' and 'off' commands are send always.
I could add condition, than when on and off commands are same, than if will not be send if device state is already assume i the required state. Would this solve your issue?
Yes, this will partially solve the problem If you use this approach, then you need to add a point that when you turn on the AC from the off state, you need to send two commands. First the "on" command, and then the command for a specific temperature state and other things. If already enabled, then yes, only the command to switch the temperature state. And to turn off - only shutdown commands
This will be simpler than my approach, but it seems to me that if the AC enable command already contains the necessary characteristics, then calling two commands instead of one is a crutch :)
Hello,
That point is already there, as I mentioned previously. If dedicated 'on' command exists it is always sent first, followed by modes and temperature combined command. So modification for sending 'on' command only if it is the same as 'off' command and if the device is in off state is relatively simple. In your case, the following combined modes and temperature command should never contain the 'on' bit. Because if it would, then you do not need this change at all - simply removing the 'on' command would fix your issue.
{ "on": "dkawmdlkwamdlkawmdlawdlmaw", "regular": "wadmpp9iunjonj" }