Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
v2.24 Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab authored and MrYsLab committed Aug 12, 2018
1 parent 6ecd509 commit 232f654
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pymata_aio/private_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PrivateConstants:
SYSEX_REALTIME = 0x7F # MIDI Reserved for realtime messages

# reserved for PyMata
PYMATA_VERSION = "2.22"
PYMATA_VERSION = "2.24"

# each byte represents a digital port
# and its value contains the current port settings
Expand Down
17 changes: 9 additions & 8 deletions pymata_aio/pymata_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""


# noinspection PyCompatibility
import asyncio
import glob
import logging
import sys
import time

# noinspection PyPackageRequirements
import serial

from pymata_aio.constants import Constants
Expand All @@ -31,7 +32,7 @@
from pymata_aio.pymata_socket import PymataSocket


# noinspection PyCallingNonCallable,PyCallingNonCallable,PyPep8,PyBroadException,PyBroadException
# noinspection PyCallingNonCallable,PyCallingNonCallable,PyPep8,PyBroadException,PyBroadException,PyCompatibility
class PymataCore:
"""
This class exposes and implements the pymata_core asyncio API,
Expand Down Expand Up @@ -203,13 +204,13 @@ def __init__(self, arduino_wait=2, sleep_tune=0.0001, log_output=False,
if self.log_output:
log_string = 'pymata_aio Version ' + \
PrivateConstants.PYMATA_VERSION + \
' Copyright (c) 2015-2017 Alan Yorinks All rights reserved.'
' Copyright (c) 2015-2018 Alan Yorinks All rights reserved.'
logging.info(log_string)
else:

print('{}{}{}'.format('\n', 'pymata_aio Version ' +
PrivateConstants.PYMATA_VERSION,
'\tCopyright (c) 2015-2017 Alan Yorinks All '
'\tCopyright (c) 2015-2018 Alan Yorinks All '
'rights reserved.\n'))
sys.stdout.flush()

Expand Down Expand Up @@ -727,7 +728,7 @@ async def get_analog_map(self):
# message to request one
if self.query_reply_data.get(
PrivateConstants.ANALOG_MAPPING_RESPONSE) is None:
await self._send_sysex(PrivateConstants.ANALOG_MAPPING_QUERY, None)
await self._send_sysex(PrivateConstants.ANALOG_MAPPING_QUERY)
# wait for the report results to return for 2 seconds
# if the timer expires, shutdown
while self.query_reply_data.get(
Expand All @@ -747,7 +748,7 @@ async def get_capability_report(self):
"""
if self.query_reply_data.get(
PrivateConstants.CAPABILITY_RESPONSE) is None:
await self._send_sysex(PrivateConstants.CAPABILITY_QUERY, None)
await self._send_sysex(PrivateConstants.CAPABILITY_QUERY)
while self.query_reply_data.get(
PrivateConstants.CAPABILITY_RESPONSE) is None:
await asyncio.sleep(self.sleep_tune)
Expand Down Expand Up @@ -779,7 +780,7 @@ async def get_firmware_version(self):
"""
current_time = time.time()
if self.query_reply_data.get(PrivateConstants.REPORT_FIRMWARE) == '':
await self._send_sysex(PrivateConstants.REPORT_FIRMWARE, None)
await self._send_sysex(PrivateConstants.REPORT_FIRMWARE)
while self.query_reply_data.get(
PrivateConstants.REPORT_FIRMWARE) == '':
elapsed_time = time.time()
Expand Down Expand Up @@ -1191,7 +1192,7 @@ async def sleep(self, sleep_time):
logging.info('sleep exception')
else:
print('sleep exception')
self.shutdown()
await self.shutdown()

async def sonar_config(self, trigger_pin, echo_pin, cb=None,
ping_interval=50, max_distance=200, cb_type=None):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='pymata-aio',
version='2.23',
version='2.24',
packages=['pymata_aio'],
install_requires=['pyserial', 'websockets'],
url='https://github.com/MrYsLab/pymata-aio/wiki',
Expand Down

0 comments on commit 232f654

Please sign in to comment.