hthiery / python-fritzhome

Python Library to access AVM Fritz!Box homeautomation
MIT License
52 stars 37 forks source link

Issues with umlauts and probably other unicode characters #9

Open pollonamid opened 6 years ago

pollonamid commented 6 years ago

Fritzbox with FritzOS 7 The program crashes when a smarthome device has an umlaut in its name.

Traceback (most recent call last): File "/usr/bin/fritzhome", line 11, in load_entry_point('pyfritzhome==0.4.0', 'console_scripts', 'fritzhome')() File "/usr/lib/python2.7/site-packages/pyfritzhome/cli.py", line 187, in main args.func(fritzbox, args) File "/usr/lib/python2.7/site-packages/pyfritzhome/cli.py", line 20, in list_all devices = fritz.get_devices() File "/usr/lib/python2.7/site-packages/pyfritzhome/fritzhome.py", line 146, in get_devices for element in self.get_device_elements(): File "/usr/lib/python2.7/site-packages/pyfritzhome/fritzhome.py", line 130, in get_device_elements plain = self._aha_request('getdevicelistinfos') File "/usr/lib/python2.7/site-packages/pyfritzhome/fritzhome.py", line 106, in _aha_request return rf(plain) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 624: ordinal not in range(128)

mjklemm commented 5 years ago

This is a typical converstation problem that I have stumpled across with my FritzBox as well. I will have a look at this and see if I can prepare a pull request to provide a fix.