-
Notifications
You must be signed in to change notification settings - Fork 50
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
Thermostat requires empty elements to be self-closing tags #66
Comments
Wrong diagnosis After some more instrumentation, the t-stat doesn’t seem to parse elements without content properly. The construction is ok. But isn’t. The t-stat prefers the self-closing version. |
My prior comment didn't have the tags escaped and doesn't make much sense with them missing. The failure scenario is:
|
XML::Simple doesn't seem to be able to convert empty tags to self-closing tags. In fact, it dioes the opposite. XML::LibXML has an option $XML::LibXML::setTagCompression = 1; that represents empty elements with begin/end elements. It defaults to representing them as self-closing. This is a bug in the XML parser in the t-stat. I don't have much hope that Carrier/Bryant are likely to fix it. |
I used XML::LibXML to "cleanse" the local systems.xml response to get config. The problem is gone. Though not a solution, I'm convinced that the problem is the t-stat is only happy with empty elements as self-closing tags. Changing libraries seems like a lot of work. Anybody have a better idea? |
There's got to be a regex expression to convert to . The thermostat is really unhappy with the former. I've worked on this for hours and all I have is a headache. This was pretty easy with SNOBOL back in the day. |
The thermostat is way too picky(in non-standard ways) with xml parsing. I've been toying with the idea of only modifying the text of xml responses from the Carrier servers rather than doing correct parsing and regeneration. In throwaway test branches I've been able to convince myself that the stat actually cares about key order as well. Facepalm. |
If it truly is the case that empty tags should always be self-closing, that's doable with an extension to XML::Simple::Minded. Possibly even with a regex on the text output, but hopefully can be done more elegantly than that. |
My experience is that <tag></tag> causes the get config payload to be
tossed and cfgpgm set to off. That's in the installer's service menu.
The hack I used to clean that up did fix the problem.
I haven't noticed a tag order issue yet. I wonder whose broken parserUTC is using.
I had three systems installed a few weeks ago. Initially, all I want to
do is set an away hold when my alarm system is armed in away mode and
return to schedule when it is disarmed.
|
very naive patch applied which converts cases of |
Works for me.
Thanks,
…On Thu, 2018-12-20 at 11:42 -0800, nebulous wrote:
very naieve patch applied which converts cases of <tag></tag> to
<tag/> Hopefully that solves your problem and doesn't blow up
anything else :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
--- Wrong assumption see next comment ---
It appears that if an api req is issued just before the window to the remote server opens, the t-stat will fetch the stale config from the remote server and not from the cache.
The text was updated successfully, but these errors were encountered: