diff --git a/pyproject.toml b/pyproject.toml index d40c44e..8aa1dd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ description = "Yet Another Framework Interface" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "cros_ec_python", + "cros_ec_python >= 0.0.2", "PyGObject" ] classifiers = [ @@ -25,4 +25,7 @@ lpc = ["portio"] [project.urls] Repository = "https://github.com/Steve-Tech/YAFI" -Issues = "https://github.com/Steve-Tech/YAFI/issues" \ No newline at end of file +Issues = "https://github.com/Steve-Tech/YAFI/issues" + +[project.gui-scripts] +yafi = "yafi:main" diff --git a/yafi/__main__.py b/yafi/__main__.py index 96ff876..cadf9c1 100644 --- a/yafi/__main__.py +++ b/yafi/__main__.py @@ -1 +1,2 @@ -from . import yafi \ No newline at end of file +from . import yafi +yafi.main() diff --git a/yafi/yafi.py b/yafi/yafi.py index cd90058..22da5ed 100644 --- a/yafi/yafi.py +++ b/yafi/yafi.py @@ -93,7 +93,7 @@ class YAFI(Adw.Application): fan_percent_scale = thermals_builder.get_object("fan-percent-scale") # Don't let the user change the fans if they can't get back to auto - if not ec_commands.general.get_cmd_versions( + if ec_commands.general.get_cmd_versions( self.cros_ec, ec_commands.thermal.EC_CMD_THERMAL_AUTO_FAN_CTRL ): @@ -141,6 +141,8 @@ class YAFI(Adw.Application): ) else: fan_set_rpm.set_sensitive(False) + else: + fan_mode.set_sensitive(False) # Temperature sensors temperatures = thermals_builder.get_object("temperatures") @@ -649,6 +651,9 @@ class YAFI(Adw.Application): self.win.present() - -app = YAFI(application_id="au.stevetech.yafi") -app.run(sys.argv) +def main(): + app = YAFI(application_id="au.stevetech.yafi") + app.run(sys.argv) + +if __name__ == "__main__": + main()