Skip to content

Support of Oclean One  #1

@hungpr0

Description

@hungpr0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions