Skip to content

how can use gatttool to read data from lywsd02 #9

Description

@ouhaiorg

Python 3.7.4 (default, Oct 15 2019, 15:58:26)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from lywsd02 import Lywsd02Client
mac = 'E7:2E:00:B2:38:35'
client = Lywsd02Client(mac)
print(client.temperature)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/lywsd02/client.py", line 44, in temperature
self._get_sensor_data()
File "/usr/local/lib/python3.7/site-packages/lywsd02/decorators.py", line 5, in wrapper
self._peripheral.connect(self._mac)
File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 446, in connect
self._connect(addr, addrType, iface)
File "/usr/local/lib/python3.7/site-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 E7:2E:00:B2:38:35, addr type: public

but same system in homeassistant,can read temperature and humidity
I want to use gatttool to find the error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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