Skip to content

Plugin fails to load. Invalid function call to "get_battery_percentage()" #10

Description

@rjDipcord

On jayfeony's repo of pwnagotchi ver: 2.8.9 the plugin fails to load, citing the function call on line 73.

capacity = int(self.ps.get_battery_percentage().value)

The traceback from the console at pwnagotchi --debug:

Exception ignored in thread started by: <function locked_cb at 0x7f839ecd60>
Traceback (most recent call last):
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/plugins/__init__.py", line 85, in locked_cb
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 450, in _make_request
    cb(*args, *kwargs)
  File "/usr/local/share/pwnagotchi/custom-plugins/pisugar2.py", line 73, in on_ui_update
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
    capacity = int(self.ps.get_battery_percentage().value)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 445, in _make_request
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_battery_percentage'
    httplib_response = conn.getresponse()

What is this intended to be referencing? I assume that we are to be pulling battery percentage data from the pisugar server, but I can't discern where that needs to take place. However, I am not a seasoned programmer. I would like to assist in resolving this if I can though.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions