Skip to content

Queue filterlist parameter: Index out of range error #21

@varna9000

Description

@varna9000

Hi, I'm trying to filter on client slide one device and one reading like this:

fhemev = fhem.FhemEventQueue("192.168.0.2",que, filterlist=[{'device':'WeatherAlarms', "reading":"code"}])

Although I see the requested reading, I'm getting the following error:

{'timestamp': datetime.datetime(2020, 3, 24, 14, 52, 13), 'devicetype': 'CustomReadings', 'device': 'WeatherAlarms', 'reading': 'code', 'value': 'Жълт', 'unit': ''}

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/fhem/init.py", line 800, in _event_worker_thread
if vl[0][-1] == ':':
IndexError: string index out of range

The script doesn't break but upon second event, I don't receive any reading anymore. Also I noticed that if reading is string containing few words (e.g. "high temperature"), it gets broken in words and only first one (eg "high") is passed to the returned dictionary and the second is passed into "units". I guess you have done it for your particular case, but it breaks up in the case which I've mentioned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions