languitar / autosuspend

A daemon to automatically suspend and wake up a system
https://autosuspend.readthedocs.io
GNU General Public License v2.0
75 stars 15 forks source link

KodiIdleTime: Remove surplus brace #564

Closed Mynacol closed 1 month ago

Mynacol commented 1 month ago

This commit fixes a syntax error in the request sent to Kodi in the KodiIdleTime check. A sample request from autosuspend is following: {{"jsonrpc": "2.0", "id": 1, "method": "XBMC.GetInfoBooleans","params": {"booleans": ["System.IdleTime(300)"]}}

It has a surplus opening curly brace at the beginning, leading Kodi to ignore the request with the following log entry: error <general>: JSONRPC: Failed to parse [the above request]

This leads to the following exception in autosuspend:

autosuspend.Processor - WARNING - Check kodi-browsing[class=KodiIdleTime] failed. Ignoring... Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/autosuspend/checks/kodi.py", line 93, in check
    if not reply["result"][f"System.IdleTime({self._idle_time})"]:
           ~~~~~^^^^^^^^^^
KeyError: 'result'
languitar commented 1 month ago

Thanks for the fix.

Before this can be merged, you need to reword your commit message to match the commit convention of the project. Could become something like "fix(kodi-idle-time): send proper requests"

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.71%. Comparing base (88f35c3) to head (8bb6dad). Report is 11 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #564 +/- ## ======================================= Coverage 95.71% 95.71% ======================================= Files 20 20 Lines 1329 1329 Branches 199 199 ======================================= Hits 1272 1272 Misses 46 46 Partials 11 11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

languitar commented 1 month ago

Thanks for updating. Still a few things that wouldn't match the convention, but these are minor. The important part is the commit type in the first line as releases are based on the type of commit. I'll ignore the rest of the linting errors and merge this now.

github-actions[bot] commented 1 month ago

:tada: This PR is included in version 7.0.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: