Skip to main content

Hivemind Websocket Client

Project description

Hivemind Websocket Client

logo

Install

pip install hivemind_bus_client

Usage

from time import sleep
from mycroft_bus_client import Message
from hivemind_bus_client import HiveMessageBusClient
from hivemind_bus_client.decorators import on_escalate, \
    on_shared_bus, on_ping, on_broadcast, on_propagate, on_mycroft_message, \
    on_registry_opcode, on_third_party, on_cascade, on_handshake, on_hello, \
    on_rendezvous, on_hive_message, on_third_party, on_payload

key = "super_secret_access_key"
crypto_key = "ivf1NQSkQNogWYyr"

bus = HiveMessageBusClient(key, crypto_key=crypto_key, ssl=False)

bus.run_in_thread()


@on_mycroft_message(payload_type="speak", bus=bus)
def on_speak(msg):
    print(msg.data["utterance"])


mycroft_msg = Message("recognizer_loop:utterance",
                      {"utterances": ["tell me a joke"]})
bus.emit_mycroft(mycroft_msg)


sleep(50)

bus.close()

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

hivemind_bus_client-0.0.2.tar.gz (12.3 kB view details)

Uploaded Source

File details

Details for the file hivemind_bus_client-0.0.2.tar.gz.

File metadata

  • Download URL: hivemind_bus_client-0.0.2.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for hivemind_bus_client-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b7fd199dd13a463819db41167a4c3defa4f1546ee6d7533cb63423b8843843ac
MD5 d326326b548ef3f4c5cb3468920d67ca
BLAKE2b-256 ce216d5a817f14d5b9300d12f1f1815b7562c7b1cb6188b213551fe4d50f5961

See more details on using hashes here.

Supported by

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