Intended behavior upon connection error
Closed this issue · 1 comments
ThomDietrich commented
Hello,
how is the library supposed to catch and propagate a connection problem?
Heres a minimal example:
flora_poller = MiFloraPoller(mac='11:22:33:44:55:66')
flora_poller.fill_cache()
print('Device name: "{}"'.format(flora_poller.name()))
This piece of code will produce:
Traceback (most recent call last):
File "./mqtt-flora.py", line 85, in <module>
print('Device name: "{}"'.format(flora_poller.name()))
File "/usr/local/lib/python3.4/dist-packages/miflora/miflora_poller.py", line 177, in name
return ''.join(chr(n) for n in name)
TypeError: 'NoneType' object is not iterable
Other functions behave similarly. Shouldn't there be an exception thrown or a cache_available
method or any other kind of error control mechanism?
ChristianKuehnel commented
Problem was already solved some time ago...