Skip to content

Commit

Permalink
Fix get_device_alarms
Browse files Browse the repository at this point in the history
example.py fails to run with:
```
 ./example.py
Traceback (most recent call last):
  File "/Users/parminderdhillon/projects/python-garminconnect/./example.py", line 20, in <module>
    from garminconnect import (
  File "/Users/parminderdhillon/projects/python-garminconnect/garminconnect/__init__.py", line 15, in <module>
    class Garmin:
  File "/Users/parminderdhillon/projects/python-garminconnect/garminconnect/__init__.py", line 727, in Garmin
    def get_device_alarms(self) -> List[str, Any]:
                                   ~~~~^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/typing.py", line 358, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/typing.py", line 1569, in __getitem__
    _check_generic(self, params, self._nparams)
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/typing.py", line 286, in _check_generic
    raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments for {cls};"
TypeError: Too many arguments for typing.List; actual 2, expected 1
```
  • Loading branch information
theboywho authored Nov 22, 2023
1 parent dee6649 commit 2fdc606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion garminconnect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def get_device_settings(self, device_id: str) -> Dict[str, Any]:

return self.connectapi(url)

def get_device_alarms(self) -> List[str, Any]:
def get_device_alarms(self) -> Dict[str, Any]:
"""Get list of active alarms from all devices."""

logger.debug("Requesting device alarms")
Expand Down

0 comments on commit 2fdc606

Please sign in to comment.