domschl / python-fhem

Python FHEM (home automation server) API
MIT License
15 stars 6 forks source link

If a device has readings with similar names get_device_reading might output unrelated results #14

Closed domschl closed 5 years ago

domschl commented 5 years ago

As described by TK67 in Fhem forum, get_device_reading returns inconsistent information, if a device has two readings, with one reading-name being a longer version of another reading, e.g. if readings myReading and myReading2 exist, then asking for myReading2 would wrongly also return results for myReading.

domschl commented 5 years ago

@Andre0512 : could you have a look at c3dbd44, I've changed your _response_filter function, because if readings: name and name1 existed, then asking for get_device_reading(dev,'name1') would return both readings for name and name1 because of:

'Value' in v and (not len(arg) or (len(arg) and k == arg[0]))} # k in arg[0]))} fixes #14

domschl commented 5 years ago

Fixed in 0.6.2