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.3.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

even_glasses-0.1.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: even_glasses-0.1.3.tar.gz
  • Upload date:
  • Size: 20.0 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.3.tar.gz
Algorithm Hash digest
SHA256 3fb1cca2ab942a55786cf0deb6e4dc56f565463d127a45f02c3f04d0b468d183
MD5 ea796eb5a9a2c00ea4b6be48765807ec
BLAKE2b-256 593650eeb283836b1e57a4d9d5523fdc6580a602c591dbfc022784e02b821a1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for even_glasses-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5ea56127cb82d94e7c9bc8c347b8c01f9d1b5f4a08448b9417889ddc10eeb1
MD5 34430920c7154e7c485d63dbf571b40d
BLAKE2b-256 0d7dd202622eaaad57b6bbd257e64985fc4afda9b1c4316213e8162e16a5601f

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