-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find_ballasts.py #36
Comments
I'd say midpoint = round((low + high) / 2) @sde1000 ? |
Hi Its a python 3 issue: In Python 3, / is float division In Python 2, / is integer division (assuming int inputs) In both 2 and 3, // is integer division |
...and you can get the python 3 behaviour in python 2 using python-dali doesn't support python 3 at the moment. I will be fixing this before the end of November because I need python 3 support myself! |
Thanks. I have been modifying the code to run with Python 3 and an RS232 interface. Do you expect the find ballast process to be quite slow? |
Depending on the number of ballasts, yes it is slow. |
Using python3 (trying to integrate DALI into home-assistant.io) and except for this all works in python3 |
Commit 27f8909 which I've just pushed may help with this. If it doesn't, can you let me know how it's failing? I don't have a test environment set up at the moment; I need to buy another DALI interface... |
well I fixed it myself in the example code :) didn't notice there were more about it in the code. Thanks for all your work! |
When running this module I get the following error:
TypeError: unsupported operand type(s) for >>: 'float' and 'int'
It appears that :
low = 0
high = 0xffffff
if response.value is True:
midpoint = (low + high) / 2
results in a value of 838607.5 (float)
Whats the fix?
The text was updated successfully, but these errors were encountered: