Skip to content

Commit

Permalink
Refactor into Neon package (#1)
Browse files Browse the repository at this point in the history
* Refactor into Neon package
Revert Changes from OpenVoiceOS#48 that added ovos-config>0.X dependency

* Undo changes from OpenVoiceOS#48 that added ovos-config>0.X dependency
  • Loading branch information
NeonDaniel authored Dec 28, 2024
1 parent 21e6726 commit 49cc163
Show file tree
Hide file tree
Showing 19 changed files with 353 additions and 252 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/conventional-label.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/propose_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Propose Stable Release
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Release Type
options:
- patch
- minor
- major
jobs:
update_version:
uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master
with:
branch: dev
release_type: ${{ inputs.release_type }}
update_changelog: True
version_file: neon_phal_plugin_system/version.py
alpha_var: VERSION_ALPHA
build_var: VERSION_BUILD
minor_var: VERSION_MINOR
major_var: VERSION_MAJOR
pull_changes:
uses: neongeckocom/.github/.github/workflows/pull_master.yml@master
needs: update_version
with:
pr_reviewer: neonreviewers
pr_assignee: ${{ github.actor }}
pr_draft: false
pr_title: ${{ needs.update_version.outputs.version }}
pr_body: ${{ needs.update_version.outputs.changelog }}
12 changes: 12 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This workflow will generate a release distribution and upload it to PyPI

name: Publish Build and GitHub Release
on:
push:
branches:
- master

jobs:
build_and_publish_pypi_and_release:
uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master
secrets: inherit
72 changes: 0 additions & 72 deletions .github/workflows/publish_stable.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will generate a distribution and upload it to PyPI

name: Publish Alpha Build
on:
push:
branches:
- dev
paths-ignore:
- 'neon_phal_plugin_system/version.py'

jobs:
publish_alpha_release:
uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master
secrets: inherit
with:
version_file: "neon_phal_plugin_system/version.py"
alpha_var: VERSION_ALPHA
build_var: VERSION_BUILD
minor_var: VERSION_MINOR
major_var: VERSION_MAJOR
publish_prerelease: true
update_changelog: true
108 changes: 0 additions & 108 deletions .github/workflows/release_workflow.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Unit Tests
# This workflow will run unit tests

name: Run Unit Tests
on:
push:
workflow_dispatch:

pull_request:
branches:
- master
jobs:
py_build_tests:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
Expand Down
38 changes: 9 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
# ovos-PHAL-plugin - system
# neon-phal-plugin-system

Provides system specific commands to OVOS.
Provides system specific commands to Neon.
The dbus interface for this plugin is not yet established.

# Install

`pip install ovos-PHAL-plugin-system`
`pip install neon-phal-plugin-system`

# Config

This plugin is a Admin plugin, it needs to run as root and to be explicitly enabled in mycroft.conf
This plugin is an Admin plugin, it needs to run as root and to be explicitly enabled in mycroft.conf

```javascript
{
"PHAL": {
"admin": {
"ovos-PHAL-plugin-system": {"enabled": true}
}
}
}
```
if not enabled (omit config above) it will be run as the regular user, you need to ensure [polkit policy](#) is set to allow usage of systemctl without sudo. Not yet implemented


handle bus events to interact with the OS

```python
self.bus.on("system.ntp.sync", self.handle_ntp_sync_request)
self.bus.on("system.ssh.status", self.handle_ssh_status)
self.bus.on("system.ssh.enable", self.handle_ssh_enable_request)
self.bus.on("system.ssh.disable", self.handle_ssh_disable_request)
self.bus.on("system.reboot", self.handle_reboot_request)
self.bus.on("system.shutdown", self.handle_shutdown_request)
self.bus.on("system.factory.reset", self.handle_factory_reset_request)
self.bus.on("system.factory.reset.register", self.handle_reset_register)
self.bus.on("system.configure.language", self.handle_configure_language_request)
self.bus.on("system.mycroft.service.restart", self.handle_mycroft_restart_request)
```yaml
PHAL:
admin:
neon-phal-plugin-system:
enabled: true
```
Loading

0 comments on commit 49cc163

Please sign in to comment.