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

ERROR: AttributeError: 'TridonicDALIUSBNoResponse' object has no attribute 'value' #66

Merged
merged 3 commits into from
Feb 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions dali2mqtt/lamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ def __init__(

self.device_name = slugify(friendly_name)

self.min_physical_level = driver.send(
gear.QueryPhysicalMinimum(short_address)
).value
logger.setLevel(ALL_SUPPORTED_LOG_LEVELS[log_level])

_min_physical_level = driver.send(gear.QueryPhysicalMinimum(short_address))

try:
self.min_physical_level = _min_physical_level.value
except Exception as err:
self.min_physical_level = None
logger.warning("Set min_physical_level to None as %s doesn't have value attribute.", _min_physical_level)
dgomes marked this conversation as resolved.
Show resolved Hide resolved
self.min_level = driver.send(gear.QueryMinLevel(short_address)).value
self.max_level = driver.send(gear.QueryMaxLevel(short_address)).value
self.level = driver.send(gear.QueryActualLevel(short_address)).value

logger.setLevel(ALL_SUPPORTED_LOG_LEVELS[log_level])

def gen_ha_config(self, mqtt_base_topic):
"""Generate a automatic configuration for Home Assistant."""
json_config = {
Expand Down
Loading