jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

Use '.lower()' instead of 'lower(...)' #79

Closed jaroschek closed 5 months ago

jaroschek commented 5 months ago

Unfortunately I did not see (and test) the latest proposed code change to fix #77

That change causes the following error:

2024-01-26 04:33:01.075 ERROR (MainThread) [homeassistant.components.number] Error while setting up myuplink platform for number
Traceback (most recent call last):
  File "/workspaces/home-assistant-core/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
    await asyncio.shield(task)
  File "/workspaces/home-assistant-core/config/custom_components/myuplink/number.py", line 30, in async_setup_entry
    if parameter.find_fitting_entity() == Platform.NUMBER:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/home-assistant-core/config/custom_components/myuplink/api.py", line 163, in find_fitting_entity
    and lower(self.enum_values[0]["text"]) == "off"
        ^^^^^
NameError: name 'lower' is not defined

We have to use .lower() as lower(...) is not defined.