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
[x] Select "Squash and merge" to keep commit timeline clean
Describe your changes
Briefly describe your changes
Check that the attr exists before attempting to get
Resolves
Checklist before submitting a pull request
requirements.txt
andmanifest.json
Checklist for reviewer