From c1ec487145677cc9cab7c764d946e720e5e4e65a Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Thu, 20 Mar 2025 17:17:14 +1000 Subject: [PATCH] GitHub workflow and fixes --- .github/workflows/flatpak.yml | 24 ++++++++++++++++++++++++ README.md | 13 +++++++++++++ yafi/__main__.py | 2 ++ yafi/thermals.py | 4 ++++ yafi/yafi.in | 4 ++-- 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 0000000..e3ac59c --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,24 @@ +name: Flatpak Build + +on: + push: + branches: [main] + pull_request: + +jobs: + flatpak: + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-47 + options: --privileged + steps: + - uses: actions/checkout@v4 + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: yafi-${{ github.sha }}.flatpak + manifest-path: au.stevetech.yafi.json + cache-key: flatpak-builder-${{ github.sha }} + - uses: actions/upload-artifact@v4 + with: + name: yafi ${{ github.sha }} + path: yafi-${{ github.sha }}.flatpak diff --git a/README.md b/README.md index 05a5808..a71b251 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,16 @@ Pipx is also supported. ### Hardware Info ![Hardware Page](docs/4-hardware.png) + +## Troubleshooting + +### `[Errno 13] Permission denied: '/dev/cros_ec'` + +This error occurs when the udev rules are not installed or not working. Make sure you have copied the `60-cros_ec_python.rules` file to `/etc/udev/rules.d/` and reloaded the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`. + +### `Could not auto detect device, check you have the required permissions, or specify manually.` + +This error occurs when `/dev/cros_ec` is not found, and the `CrOS_EC_Python` library also cannot talk over LPC. +You can either update your kernel to have a working `cros_ec_dev` driver, or run YAFI as root. + +It can also occur if you do not have a CrOS EC, like on non Framework laptops. diff --git a/yafi/__main__.py b/yafi/__main__.py index e69de29..031df43 100644 --- a/yafi/__main__.py +++ b/yafi/__main__.py @@ -0,0 +1,2 @@ +from . import main +main() diff --git a/yafi/thermals.py b/yafi/thermals.py index ca54600..a1d6883 100644 --- a/yafi/thermals.py +++ b/yafi/thermals.py @@ -95,6 +95,10 @@ class ThermalsPage(Gtk.Box): self.fan_mode.set_sensitive(False) # Temperature sensors + while temp_child := self.temperatures.get_last_child(): + self.temperatures.remove(temp_child) + self.temp_items.clear() + try: ec_temp_sensors = ec_commands.thermal.get_temp_sensors(app.cros_ec) except ec_exceptions.ECError as e: diff --git a/yafi/yafi.in b/yafi/yafi.in index 3423b16..e3fe505 100755 --- a/yafi/yafi.in +++ b/yafi/yafi.in @@ -43,5 +43,5 @@ if __name__ == '__main__': resource = Gio.Resource.load(os.path.join(pkgdatadir, 'yafi.gresource')) resource._register() - from yafi import main - sys.exit(main.main()) + import yafi + sys.exit(yafi.main())