-
Notifications
You must be signed in to change notification settings - Fork 25
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
Skip nan for setting level. #65
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dusan Cervenka <cervenka.dusan@gmail.com>
related to #64 |
Signed-off-by: Dusan Cervenka <cervenka.dusan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this solution at all... it's too specific to your Tridonic driver implementation, and this daemon is supposed to be generic :/
I believe it is best to just ignore non numeric values
Well ok we can ignore them. But we need set some value here otherwise your next lines will not work. Anyway this last commit not work for me. It looks like i am not able to get actuall value at all |
47a0a64
to
2c90a70
Compare
I returned to one commit earlier |
I wouldn't say it is specific to my dali converter as the MASK definition usage is placed in general code. Of course it maybe be used so far for my case only. |
@@ -90,6 +90,15 @@ def level(self): | |||
@level.setter | |||
def level(self, value): | |||
"""Commit level to ballast.""" | |||
|
|||
if not isinstance(value, (int, float)): | |||
if hasattr(self, '__level'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets keep this simple, not a number ? we return without setting any value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need set value, otherwise you program will crash later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you provide a traceback of later ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are accessing the value (maybe HA is asking state) and as it is not set the attribute doesn't exists. So first time there need be some value set. But we don't want overwritte existing values if they were set already.
No description provided.