1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

121 Commits

Author SHA1 Message Date
Andrey Pokhilko
92c6e3f26e Merge branch 'master' of github.com:undera/pylgbst into bleak-troubleshooting 2020-07-04 09:38:51 +03:00
Andrey Pokhilko
c73311528d Cosmetics around bleak 2020-07-04 09:29:55 +03:00
Andrey Pokhilko
812ca1ad15 Alternate implementation 2020-06-30 12:16:44 +03:00
Andrey Pokhilko
94db2840f4
Allow finding hub by name (#68)
* Cosmetics

* Add hub name parameter

* Fix tests

* Fix test

* Fix conn priority
2020-06-27 15:26:47 +03:00
Andrey Pokhilko
3c2f0b493b
Experiment with Bleak changes (#55)
* Introduce driver that works with Bleak, enables to use BLE devices in windows without a need of external BLE dongle.

* Fix issues in auto review.

* Add method description and UT.

* Fix docstring to comply with pep257

* Experiment

* Make test only work in 3.7+

* Fix versions

* One more try

* Kick it

* Kick

* cmon

* Dummm

* yeah yeah

* Add

* Fix version

Co-authored-by: mgr <tomekmgr@gmail.com>
2020-06-27 13:45:53 +03:00
Andrey Pokhilko
c47fb2326a
Offer alternative fix for start_power commands (#53)
* Offer alternative fix

* Fix test

* Dummy commit

* fix

* Decrease coverage

* fix test

* turn into comments

* Empty it

* Rollback experiment
2020-03-07 09:36:30 +03:00
laurentchar
69b234b924
peripheral:EncodedMotor: fixed goto_position() (#50) 2020-02-08 15:18:15 +03:00
laurentchar
d1019ac9f4
peripheral:Motor: fixed _speed_abs for END_STATE_BRAKE (#48) 2020-01-30 22:03:33 +03:00
MDE
dff312534f
Added test and fix for device matching (#46)
* Added test for device matching

Mocking the scanning and testing the connect() of each backend would be
better, but that requires more refactoring with prior agreement.
Added unittest2 dependency for subTest support, other solutions are
available.

* Fixed matching for Move Hub

If other BLE devices are around, an exception occurs on hub_mac.lower() if
default hub_mac (None) is used.

* fixup! Added test for device matching

Removed unittest2 dependency and features
2020-01-29 09:33:53 +03:00
Andrey Pokhilko
17e22bf810 Use command codes in write direct 2020-01-28 20:53:28 +03:00
laurentchar
300268a2ab Update peripherals.py (#45) 2020-01-09 13:45:02 +03:00
Andrey Pokhilko
c71befdb66 Update handler signature 2019-12-27 22:36:14 +03:00
Andrey Pokhilko
6a49f5c840 Enable subscribing to LED notifications 2019-12-27 22:18:51 +03:00
Andrey Pokhilko
0a4227d132 Refactoring 2019-12-27 22:07:22 +03:00
Andrey Pohilko
907a2dd561 Cosmetics 2019-12-27 10:34:04 +03:00
Mike C. Fletcher
c955820521 Bunch of Tiny Fixes and Enhancements (#41)
* Use setuptools to allow the extras_require to work in python3.6

This also declares some hidden dependencies for the underlying
connection protocols, but note that they are normally reliant
on system-packaged versions, which is a bit less than optimal.

* In message, on assert of incoming type, note failing type

* In utilities, guard against truncated input.

* In demo allow for specifying different connections and demos on command line

Also addresses a crash in led demo where parameters x and y were not provided
to an empty lamba that was passed in.

* Remove commentted line, apply black formatting

* Raise TypeError when an incorrectly-typed message is received

* Apply black automatic formatting to the utilities module
2019-12-27 10:27:59 +03:00
Andrey Pokhilko
64776eadc8 Fix issue #40 2019-12-26 14:37:23 +03:00
Andrey Pokhilko
9abe2495b0 Fix issue #39 2019-12-26 14:31:51 +03:00
Andrey Pokhilko
c11e8fbd18 A bit of refactoring 2019-12-20 14:39:34 +03:00
Mariusz Woloszyn
cde1bea308 Orange color fix (#35) 2019-11-12 20:36:14 +02:00
Andrey Pokhilko
a6a5f12e6c Make all backends aware of zero address 2019-09-07 23:10:34 +03:00
Andrey Pokhilko
5deafe9d4a Fix name of Hub 2019-08-23 13:24:32 +03:00
Andrey Pokhilko
c9112d8fe4 Progressing 2019-08-14 23:29:08 +03:00
Andrey Pokhilko
f3e4a9dbdb Preparing joystick operations 2019-08-14 13:58:55 +03:00
Andrey Pokhilko
33364e4e3b Fix hanging on button subscribe 2019-08-14 13:17:15 +03:00
Andrey Pokhilko
fc08a495b1 It seems LEGO has renamed Move Hub in FW update 2019-08-14 11:04:58 +03:00
Andrey Pokhilko
6ad116fe1c Change button callback into 3-state 2019-08-14 11:04:29 +03:00
Andrey Pokhilko
3f19c983c2 Merge branch 'master' of github.com:undera/pylgbst 2019-08-13 15:45:59 +03:00
Ingo Jache
990ccdb268 New LEGO-Boost Firmware 2.0.00.0017 breaks pylgbst... (#33)
* - Updated Port-Numbers (New Firmware 2.0.00.0017)
- Skipping Device without Mac-Address
(Seems to occur randomly after Firmware-Update,
referring to https://github.com/LLK/scratch-vm/issues/2230 )
- Fixed racecondition in Hub.send()
(Reply could come before entering _sync_lock)

* - fixed Unit-Tests (Changed Port-Numbers)
- moved the write-call in hub.send() outside the lock
2019-08-12 10:38:04 +03:00
Andrey Pokhilko
6da6797374 Working code for BB8 joystick 2019-08-04 23:44:28 +03:00
Tomas Smetana
02d1ca0188 Accept also bytearray type for message (#29) 2019-06-16 09:34:33 +03:00
Andrey Pokhilko
32eecac1a6
Make v1.0, based on official docs (#27)
* It's HUB ID

* Rename file

* Working with official doc

* Some progress

* AttachedIO msg

* device action impl

* some better device alert impl

* restructuring

* Some port commands handled

* Some command feedback waiting

* Some more request-reply things

* Some more request-reply things

* Reworked msg classes

* Getting back to UTs

* Getting back to UTs

* Facing sync lock problems

* Facing sync lock problems

* Testing it

* Covering more with tests

* handle actions

* Hub class is almost covered

* done coverage for Hub

* done coverage for MoveHub

* Button is tested

* remove debug server from examples

* Current and voltage tested

* color sensor basic test

* cover tilt sensor

* motor sensor tested

* constant motor

* motor is tested

* hold_speed impl for motor

* motor commands recorded

* some cleanup

* some cleanup

* some cleanup

* debug

* debug

* FIX a bug

* acc/dec profiles figured out

* UT motor ops

* UT motor ops

* Get rid of weird piggyback

* fix UT

* Fix encoding?

* fix test mb

* More robust

* Checked demo works

* cosmetics

* cosmetics

* Maybe better test

* fetching and decoding some device caps

* describing devs

* describing devs works

* Applying modes we've learned

* Simple and extensible dev attach

* Reworking peripherals based on modes

* Applying modes we've learned

* implemented getting sensor data

* fixed port subscribe

* Added led out cmds on vision sensor

* Worked on color-distance sensor

* Introduce some locking for consistency

* Improved it all

* Travis flags

* improve

* improve

* improve docs
2019-05-30 17:02:50 +03:00
Andrey Pohilko
b4f5481fbe Cosmetics 2019-03-23 13:49:50 +03:00
Vasily Loginov
dc1c388fe8 Bluepy comm (#18)
* Added support for bluepy communication backend.

* Added bluepy information into the readme.

* Added tests, fixed dependency specs in setup.py.

* Fixed dep in travis.

* Removed unused import. Added ability to fail the application on dispatcher thread error.

* Fixed bluepy test to be more appropriate.

* Properly handle hub mac if set.
2019-01-28 22:13:07 +03:00
Andrey Pohilko
f078d188ae Fix #10
Fixes #10
2019-01-16 10:42:52 +03:00
Andrey Pohilko
f4efb30133 Implement abstract method 2019-01-06 15:44:21 +03:00
Andrey Pohilko
b64fb41572 Async is reserved word 2019-01-06 15:43:10 +03:00
Andrey Pohilko
985f528359 Better disconnect for Gatt 2019-01-06 11:11:53 +03:00
Andrey Pohilko
ddb65ec043 Remove empty clashing file
Fixes issue #12
2018-08-12 19:40:32 +03:00
Andrey Pohilko
881ba1d619 Color tracking 2018-08-02 21:37:49 +03:00
Andrey Pohilko
4a6f948fc5 A way to check if connection is alive 2018-08-01 15:39:17 +03:00
Andrey Pohilko
b4605ae42b Face tracker example 2018-07-31 23:04:29 +03:00
Andrey Pohilko
3c8e6b4cbb Refactor 2018-07-30 12:51:11 +03:00
Andrey Pohilko
0c6409a3e3 better order for autoconnect 2018-07-30 12:43:36 +03:00
Andrey Pohilko
c676d09ba2 Fixups after testing 2018-07-30 12:31:22 +03:00
Andrey Pokhilko
16b1612cc6
Review pygatt (#11)
* Cosmetics

* Harmonograph demo

* Cleanup

* Original

* Original

* Cosmetics

* Original file

* Fixes

* cosmetics

* separate classes

* Cosmetics

* Cosmetics

* fix tests

* Remove plotter tests

* Add bluegiga

* Rename it

* Progress

* Fix tests

* Cosmetics

* Found a way for pygatt!

* Playing with gatt

* Fix hung subscribe

* rename class

* add test

* skeleton for autodetect

* safer order

* Fix tests

* Fix test

* Add dbus install

* another try

* 2

* 3

* 34

* 6

* 7

* Isolate some tests

* 8

* back to roots

* Try more

* 9

* Help

* rep

* site-packs

* Fix?

* Py3 come on

* dbus

* busss

* dev null!

* Fix test

* Cleanup

* Fix tests

* Fix after review

* add package

* FIx package paths

* Cosmetics

* Update

* More doc
2018-07-18 13:57:58 +03:00
Andrey Pohilko
737d955da4 Cosmetics 2018-02-02 16:54:53 +03:00
Andrey Pohilko
83be117966 Drop port data in case handler is too slow 2018-01-28 08:39:26 +03:00
Andrey Pohilko
039a5030fd Fix release issues 2017-12-29 10:47:19 +03:00
Andrey Pohilko
dc863f11b1 Fix bug of not connected 2017-12-29 10:41:33 +03:00