Metadata-Version: 2.2
Name: gshock_api
Version: 2.0.1
Summary: Pythgon API for GShock Watches using BLE
Home-page: https://github.com/pyscaffold/pyscaffold/
Author: Ivo Zivkov
Author-email: Ivo Zivkov <izivkov@gmail.com>
Platform: any
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: requests

GShockTimeServer
================

Overview
========
GShockTimeServer allows you to set the correct time on your Casio G-Shock watches, including:

- `B5600 <https://amzn.to/3Mt68Qb>`__
- `B5000 <https://amzn.to/4194M13>`__
- `B2100 <https://amzn.to/3MUDCGY>`__

Additionally, this repository provides an API for developing applications for these watches.  
While still a work in progress, you can refer to the ``api_tests.py`` file for usage examples.

Usage
=====
This app can run on any device with Python and Bluetooth capabilities—from a desktop to a Raspberry Pi Zero.  
It has been tested on Linux but should also work on Windows.

.. image:: images/pizero.jpg
   :alt: Pi Zero Running the Server
   :align: center

Setting the Time
----------------
1. Ensure the app is running on your device.
2. Short-press the **lower-right** button on your G-Shock watch to connect.
3. Once connected, the app will automatically set the correct time on your watch.
4. If **AUTO TIME ADJUSTMENT** is enabled, the watch will sync up to **four times daily**.

Dependencies
============

This project requires the following Python packages:
```
pytz
bleak
```

So you can install them using the following command:
```
pip3 install -r requirements.txt
```

Virtual Environment Setup
=========================
To run the server in a virtual environment:

1. Create a virtual environment:

.. code-block:: sh

   # Create a virtual environment
   python3 -m venv myenv

   # Activate it (Mac/Linux)
   source myenv/bin/activate

   # Install dependencies
   pip3 install -e .

2. Run the tests:

.. code-block:: sh

   python3 src/examples/api_tests.py [--multi-watch]

3. Run the server:

.. code-block:: sh

   python3 src/examples/gshock_server.py [--multi-watch]

The optional **`--multi-watch`** parameter allows you to connect if you have multiple watches.

Troubleshooting:
================
If your watch cannot connect, and the 
**`--multi-watch`** parameter is not used, remove the **`config.ini`** file and try again.
