Skip to content

Conversation

@arouze
Copy link

@arouze arouze commented Oct 24, 2024

Hello 👋

Thanks for your work !
I have an issue with your package on homeassistant.

here the message when I try to access to the sensor :

ERROR (MainThread) [homeassistant.components.sensor] Error while setting up bbox 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 "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bbox/sensor.py", line 104, in setup_platform
    bbox_data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 184, in wrapper
    result = method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bbox/sensor.py", line 198, in update
    box = pybbox.Bbox()
          ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pybbox/__init__.py", line 21, in __init__
    self.bbox_url = BboxAPIUrl(None, None, ip)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pybbox/bboxApiURL.py", line 25, in __init__
    self.build_url_request()
  File "/usr/local/lib/python3.12/site-packages/pybbox/bboxApiURL.py", line 53, in build_url_request
    if net.IPAddress(self.ip).is_private():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'IPAddress' object has no attribute 'is_private'

It seems that the is_private() method was delete in [email protected].
This PR just replace the is_private method by the is_ipv4_private_use (bbox use only ipv4 right ?! ).

BTW, I'm not a python developper, sooo if you want to check / drop / update by PR it's fine !

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.

1 participant