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

Configure sensor to check that attr exists before getting #92

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

s3than
Copy link
Contributor

@s3than s3than commented Oct 17, 2024

Describe your changes

Briefly describe your changes

Check that the attr exists before attempting to get

Resolves

2024-10-17 23:15:48.706 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up dirigera_platform platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/dirigera_platform/sensor.py", line 128, in async_setup_entry
    if getattr(hub_outlet.attributes,attr) is not None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OutletAttributes' object has no attribute 'current_amps'

Checklist before submitting a pull request

  • Updated base lib and added the required version in the requirements.txt and manifest.json

Checklist for reviewer

  • Select "Squash and merge" to keep commit timeline clean

@sanjoyg sanjoyg merged commit 2f99a66 into sanjoyg:main Oct 18, 2024
3 checks passed
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