jheling / freeathome

Free@Home component for Home Assistant
112 stars 41 forks source link

Component fails to start #14

Closed certl closed 5 years ago

certl commented 5 years ago

The freeathome component fails to start, if a cover is in a position that cannot be casted to integer. The problem is in line 604 in file pfreeathome.py. The cover position comes as string from the xml data. Trying to cast a string value of e.g. "75.356" will result in an unhandled exception and the component will not start. Replacing line 604 with the following fixes the problem: cover_position = str(abs(100 - int(float(get_output_datapoint(channel, 'odp0001')))))

jheling commented 5 years ago

I have added the fix to the repository. I have also applied the float to the update message. Thank you for the call.