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.4.tar.gz
(24.2 kB
view details)
Built Distribution
File details
Details for the file even_glasses-0.1.4.tar.gz
.
File metadata
- Download URL: even_glasses-0.1.4.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46603512f0bc0131b34f285f7caf6855aa11eea47622192a4dfaeadefdad8aed |
|
MD5 | a62ef937011042d23006243bb0db7e0d |
|
BLAKE2b-256 | 5f6121b23aa7afeeb545587b6a0cd646f1efecbb0f279a415e005e948a239690 |
File details
Details for the file even_glasses-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: even_glasses-0.1.4-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae5c5213d544eca8a3e64693a48a6acec93fb3bb2a894082c45fff54f2254ea5 |
|
MD5 | a57028397ddf05044324ba473a45b483 |
|
BLAKE2b-256 | de577020ee32f56f38113ee51abcca6e9c0b174754eabc43f9d680a2df1cabb8 |