steinrobert / python-toothbrush Goto Github PK
View Code? Open in Web Editor NEWpython package to read data from bluetooth toothbrushes
License: MIT License
python package to read data from bluetooth toothbrushes
License: MIT License
Hello,
Thanks for your work.
I'm checking to have my toothbrush added to Home assistant. Here is the production: https://www.oclean.com/en/one/
It was requested on https://community.home-assistant.io/t/oclean-one-bluetooth-toothbrush/105853
I try to run your script but it doesn't work on my side. Can you please help?
I created fancy.py
cat python-toothbrush/toothbrush/fancy.py
from toothbrush.base import Toothbrush
from toothbrush.constants import ROUTINE, INTENSITY
class FancyToothbrush(Toothbrush):
attributes = [ROUTINE, INTENSITY] # defines which attributes are available
handles = { # defines under which handle the attributes can be read
INTENSITY: 0x11,
ROUTINE: 0x12
}
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from toothbrush.fancy import FancyToothbrush
>>> fancy = FancyToothbrush("70:28:45:xx:xx:xx")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/python-toothbrush/toothbrush/base.py", line 14, in __init__
self.update()
File "/root/python-toothbrush/toothbrush/base.py", line 21, in update
peripheral = self.peripheral
File "/root/python-toothbrush/toothbrush/base.py", line 18, in peripheral
return Peripheral(self.address, "public")
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 391, in __init__
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 70:28:45:xx:xx:xx, addr type: public
70:28:45:xx:xx:xx is my Oclean X toothbrush MAC address
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.