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

Flet application

pip3 install -r requirements.txt
flet run

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

Uploaded Source

Built Distribution

even_glasses-0.1.5-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: even_glasses-0.1.5.tar.gz
  • Upload date:
  • Size: 23.8 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.5.tar.gz
Algorithm Hash digest
SHA256 9c2e9929e274d3aaf83e3e5163d5023b0f74e1756d709b16fea587c7ab89f2e3
MD5 53033000dee8ed411fe1bd4468b4bc73
BLAKE2b-256 5841f8ded8492df3a1322aa0c89a082bf8820cfef8b8b9267e054b704920ddcf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for even_glasses-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 654afd609fa2ad44a66476b2834cb9ef4fd430024c9255052e0f913f4c8f2a4a
MD5 908835221dc93dcc23f49dee1528de62
BLAKE2b-256 34c7f6f1233a041fedba235abb16ea5678ce1c9fe2c1339471160940e69726fa

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