Skip to main content

A Python package for managing even-realities glasses devices via BLE.

Project description

even_glasses

even-realities g1 smart glasses BLE control pip package

Installation

To install the package, use pip:

pip3 install even_glasses

Usage

Here is an example of how to use the even_glasses package to control your smart glasses:

import asyncio
import logging
from even_glasses import GlassesProtocol

logging.basicConfig(level=logging.INFO)
glasses = GlassesProtocol()

async def main():

    try:
        await glasses.scan_and_connect(timeout=10)

        def status_changed(address, status):
            logging.info(f"[{address}] Status changed to: {status}")

        glasses.on_status_changed = status_changed

        while True:
            test_message = "Hello, Glasses!\nThis is a test message.\nEnjoy your day!"
            await glasses.send_text_to_all(test_message)
            logging.info("Sent test text message to all glasses.")
            await asyncio.sleep(20)

    except KeyboardInterrupt:
        logging.info("KeyboardInterrupt received. Initiating shutdown...")
    except Exception as e:
        logging.error(f"Unhandled exception: {e}")
    finally:
        await glasses.graceful_shutdown()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        logging.info("Program terminated by user.")
    except Exception as e:
        logging.error(f"Unhandled exception in main: {e}")

Features

  • Scan for nearby smart glasses and connect to them
  • Send text messages to all connected glasses
  • Receive status updates from glasses

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

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

even_glasses-0.1.2.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

even_glasses-0.1.2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file even_glasses-0.1.2.tar.gz.

File metadata

  • Download URL: even_glasses-0.1.2.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for even_glasses-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2113a0297a2e96cd16d268c0e6d079223da113a6f6a1d55d42ea8e389196c50e
MD5 0e2e64d390181be89871802ada7044d0
BLAKE2b-256 6f39ece5d9599c3505c8c73dff647fca55da6b7b75b738c9e42f74354a3ab653

See more details on using hashes here.

File details

Details for the file even_glasses-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for even_glasses-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7f27fb6c99216e833b8d89fb9584194daade29623e6f3321ef2685cee42bdf7
MD5 d2c5620b9671cfe15fcba594cddb7040
BLAKE2b-256 74617ca1b9c250f918323861a1287d905e427e4c365693ff8863d13d25df0325

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