Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of assistant.py #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 38 21 * * *
name: Semgrep
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
27 changes: 27 additions & 0 deletions assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import wolframalpha
import os
import sys
import pyjokes

engine = pyttsx3.init('sapi5')

Expand Down Expand Up @@ -54,6 +55,17 @@ def myCommand():
query = str(input('Command: '))

return query

def joke():
speak(pyjokes.get_jokes())

def cpu():
usage=str(psutil.cpu_percent())
speak("CPU is at"+usage)

battery = psutil.sensors_battery()
speak("battery is at")
speak(battery.percent)


if __name__ == '__main__':
Expand Down Expand Up @@ -104,6 +116,9 @@ def myCommand():
speak('okay')
speak('Bye Sir, have a good day.')
sys.exit()

elif 'joke' in query:
joke()

elif 'hello' in query:
speak('Hello Sir')
Expand All @@ -120,6 +135,18 @@ def myCommand():

speak('Okay, here is your music! Enjoy!')

elif 'date' in query:
date_()


elif 'cpu' in query:
cpu()


elif 'go offline' in query:
speak("going offline sir")
quit()


else:
query = query
Expand Down