Skip to main content

control your google home

Project description

googlecontroller

Library for Python 3.8+ to push text message or audio file with the Google Home.Originally made by - Thomas Deblock (@tdeblock) I have expanded most of the code quite a bit little of the original remains, but the idea came from Mr.Deblock.This is a sorta v2 for the googlehomepush module they made.

Installation

pip install https://github.com/dray-cyber/googlecontroller

Depending On

PyChromeCast

How to use

from googlecontroller import GoogleAssistant
from googlecontroller.http_server import serve_file # for local files
host = "ip"
home = GoogleAssistant(host=host)
home.say("test")
home.play("http://www.hubharp.com/web_sound/BachGavotteShort.mp3")

file_url = serve_file("/path/to/file", "audio/mp3") # local
home.play(file_url, "audio/mp3")
home.volume(100)
home.volume(0)

.say(text, speed,ignore, lang)

Push a message on Google home

  • text is the test message to say
  • speed is the rate of speed of the message ranges from 0.000+ as slowest to 1 as normal speed.
  • ignore ignore if audio is playing and play it regardless if ignore=True and only play if not playing if ignore=False or is not specified.
  • lang the text language, default value is 'en' to change it have lang = 'language' as described in google translate en-Us, es (spanish), ect

.play(url, ignore, contentType = 'audio/mp3'):

Push a sound to Google home

  • url an audio file URL
  • ignore ignore if audio is playing and play it regardless if ignore=True and only play if not playing if ignore=False or is not specified.
  • contentType the audio file content type

.volume(volumelevel):

  • volumelevel the volume level from 0-100 by 0.01 to 1 Example: home.volume(volumelevel=0.05 or 5 percent volume. If you want to take it as user input you can do volumelevel=float(input()) the float is required to convert it as it is a decimal.

Maintainers

  • Dray-Cyber

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

googlecontroller-3.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

googlecontroller-3.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file googlecontroller-3.0.0.tar.gz.

File metadata

  • Download URL: googlecontroller-3.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for googlecontroller-3.0.0.tar.gz
Algorithm Hash digest
SHA256 8cfe4ec29f40689b44a8ad1f2910d25c4d8d5defd7b3b2d1d83c78127983a33a
MD5 5e66ab2a4732a278a4cd0267355453f2
BLAKE2b-256 e9a14666c9d691f10b0d0de12d926491208fd5fc1a29e6804fbc434b4dee9a0e

See more details on using hashes here.

File details

Details for the file googlecontroller-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: googlecontroller-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for googlecontroller-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89c8cc7c128bdb45071c573cd2469cd313bf9993ba4ec4e136607642e6930360
MD5 b0409084bd65e94c611bda6797aa616a
BLAKE2b-256 6055fe4361edd162ce54c31c74b0251baa3b0a0d6169a8ef67a1ccc4d003c9b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page