Skip to content

Commit

Permalink
ERROR: AttributeError: 'TridonicDALIUSBNoResponse' object has no attr…
Browse files Browse the repository at this point in the history
…ibute 'value'

It looks like the dali device is not able to return physical minimum value some amount of time when it is turned on. It looks like variable is not used anyway so i bypassed it for now

Signed-off-by: Dusan Cervenka <[email protected]>
  • Loading branch information
Hadatko committed Feb 3, 2024
1 parent e73fc1a commit bb800e3
Showing 1 changed file with 9 additions and 5 deletions.
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(f"Set min_physical_level to None as {_min_physical_level} doesn't have value attribute.")
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

0 comments on commit bb800e3

Please sign in to comment.