-
Notifications
You must be signed in to change notification settings - Fork 13
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 handling of various types of values #26
Fix handling of various types of values #26
Conversation
Without this fix FriendlyName1 cannot be cleared, for example.
The original code converted all values to strings while subsequent code is present for differentiating between dict and other value types, which was meaningless. Now when keeping the original value type, a dict can be written out correctly again.
@treitmayr thank you very much for your contribution. See: 988f690 Rule config
I am running your change against a "Tasmota 9.1.0" device and this is the incoming existing data:
I am getting the following error:
I assume that you are running the role aginst a different tasmota version and the response for the existing data has changed. |
@tobias-richter you are right, I tested against 10.0.0, and there the output on the console looks like
I will downgrade one of my nodes (hopefully that can be done) and fix the commit by auto-detecting if the original format or the new one is being used. Not sure if I find the time before xmas though. |
@treitmayr no problem, take your time! |
711037a
to
3131de1
Compare
The current version should now work for both rule responses (tasmota versions < 10.0.0 vs. >= 10.0.0), I tested it with 9.1.0 and 10.1.0. Please give it a try and check if the changes are fine for you. |
@treitmayr happy new year and thank you for the Update. I have successfully tested the new version with 10.1.0 and 9.1.0 devices. |
I wanted to configure my new set of rebranded Gosund SP111 and stumbled across two issues which this PR shall fix.
FriendlyNameX
(X e [1;8])The issue here was that just the command name and a single space separating the command from its value were sent. The empty value however needs to be specified as an empty pair of quotes. -> Added special handling for empty string values.
_get_arg_or_var()
always converted its return value to a string. The symptom was that this string was no proper JSON line (mainly single quotes instead of double quotes) therefore I was not able to configure the tasmotaTemplate
.None
. That seems to work now reliably.With the changes my own playbooks work but I did not test some of the very specific commands not applicable to my devices (or at least to my setup). So please check if the changes may break things in different areas.