Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hadatko
Copy link
Contributor

@Hadatko Hadatko commented Feb 2, 2024

No description provided.

Signed-off-by: Dusan Cervenka <cervenka.dusan@gmail.com>
@Hadatko
Copy link
Contributor Author

Hadatko commented Feb 3, 2024

related to #64

Signed-off-by: Dusan Cervenka <cervenka.dusan@gmail.com>
Copy link
Owner

@dgomes dgomes left a 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

@Hadatko
Copy link
Contributor Author

Hadatko commented Feb 3, 2024

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

@Hadatko
Copy link
Contributor Author

Hadatko commented Feb 3, 2024

I returned to one commit earlier

@Hadatko
Copy link
Contributor Author

Hadatko commented Feb 3, 2024

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'):
Copy link
Owner

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

Copy link
Contributor Author

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

Copy link
Owner

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 ?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants