Closed mikelawrence closed 6 years ago
Unfortunately, the way the fan sends these makes it difficult to parse. I thought what I had always worked, but it seems that isn't the case.
I would be glad to look at a PR.
Closing as fix was merged. This output might be usable for #27 .
I am using SenseMe with monitoring enabled and get_attribute(). I have had a lot of problems get_attribute() causing key errors for say
'FAN;SPD;ACTUAL'
. Note it doesn't always cause a key error only sometimes. What I think is happening is _get_all_request() is mishandling two sections in one string.Running following code
pprint.pprint(device._get_all_request())
produces the following results:I think this shows
'FAN;SPD;ACTUAL'
will never end up as a key. Note that the two sections on one line is not consistent so sometimes'FAN;SPD;ACTUAL'
will exist as a key.Adding
.replace(')(', ')||(')
to your_get_all_request()
fixes the problem for me.Now
pprint.pprint(device._get_all_request())
produces: