Skip to content

Commit

Permalink
Merge pull request #121 from martinohanlon/dev
Browse files Browse the repository at this point in the history
v1.3.1
  • Loading branch information
Martin O'Hanlon authored Jan 1, 2019
2 parents fe8b255 + 9e1711b commit a90a3c8
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 17 deletions.
12 changes: 11 additions & 1 deletion bluedot/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,24 @@ def __init__(self,
auto_connect)

def connect(self):
"""
Connect to a Bluetooth server.
"""
self._server.mock_client_connected(self)
self._connected = True

def disconnect(self):
"""
Disconnect from a Bluetooth server.
"""
self._server.mock_client_disconnected()
self._connected = False

def mock_server_sending_data(self, data):
"""
Simulates a server sending data to the
:class:`~.btcomm.BluetoothClient`.
"""
if self._connected:
self._data_received_callback(data)

Expand Down Expand Up @@ -259,7 +269,7 @@ def launch_mock_app(self):
The mock app uses pygame which will need to be installed.
"""
self._mock_app_thread = WrapThread(target=self._launch_mock_app2)
self._mock_app_thread = WrapThread(target=self._launch_mock_app)
self._mock_app_thread.start()

def _launch_mock_app(self):
Expand Down
6 changes: 0 additions & 6 deletions docs/btcommapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ BluetoothAdapter

.. autoclass:: BluetoothAdapter

MockBluetoothServer
-------------------

.. module:: bluedot.mock

.. autoclass:: MockBluetoothServer
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Change log
Bluedot Python library
----------------------

1.3.1 - 2019-01-01
~~~~~~~~~~~~~~~~~~

* minor bug fix to launch_mock_app

1.3.0 - 2018-12-30
~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 0 additions & 5 deletions docs/dotapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ BlueDotRotation
---------------

.. autoclass:: BlueDotRotation

MockBlueDot
-----------

.. autoclass:: MockBlueDot
Binary file modified docs/images/mockbluedot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Table of Contents
bluedotpythonapp
dotapi
btcommapi
mockapi
protocol
build
changelog
22 changes: 22 additions & 0 deletions docs/mockapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Mock API
========
Blue Dot also contains a useful :mod:`mock` API for simulating Blue Dot and
bluetooth comms. This is useful for testing and allows for prototyping
without having to use a Blue Dot client.

.. module:: bluedot.mock

MockBlueDot
-----------

.. autoclass:: MockBlueDot

MockBluetoothServer
-------------------

.. autoclass:: MockBluetoothServer

MockBluetoothClient
-------------------

.. autoclass:: MockBluetoothClient
2 changes: 1 addition & 1 deletion examples/mock_app_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def moved(pos):
mbd.start()

#launch a mock app
mbd.launch_mock_app2()
mbd.launch_mock_app()

try:
while True:
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

__project__ = 'bluedot'
__desc__ = 'A zero boiler plate bluetooth remote'
__version__ = '1.3.0'
__version__ = '1.3.1'
__author__ = "Martin O'Hanlon"
__author_email__ = 'martin@ohanlonweb.com'
__license__ = 'MIT'
Expand Down Expand Up @@ -49,15 +49,15 @@
1. Install
```bash
```
sudo pip3 install bluedot
```
2. Get the [Android Blue Dot app](http://play.google.com/store/apps/details?id=com.stuffaboutcode.bluedot) or use the [Python Blue Dot app](http://bluedot.readthedocs.io/en/latest/bluedotpythonapp.html)
3. Pair your Raspberry Pi
4. Write some code:
4. Write some code
```python
from bluedot import BlueDot
Expand All @@ -82,7 +82,7 @@
## Even more
The [online documentation](http://bluedot.readthedocs.io/en/latest/) describes how to use Blue Dot and the Python library including Recipes and ideas.
The [online documentation](http://bluedot.readthedocs.io/en/latest/) describes how to use Blue Dot and the Python library including recipes and ideas.
"""

Expand All @@ -97,6 +97,7 @@
author_email = __author_email__,
license= __license__,
keywords=__keywords__,
classifiers=__classifiers__,
packages = [__project__],
#install_requires = __requires__,
entry_points={
Expand Down

0 comments on commit a90a3c8

Please sign in to comment.