Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'miband' object has no attribute 'artist' #1

Closed
janvda opened this issue Nov 16, 2021 · 2 comments
Closed

AttributeError: 'miband' object has no attribute 'artist' #1

janvda opened this issue Nov 16, 2021 · 2 comments

Comments

@janvda
Copy link
Owner

janvda commented Nov 16, 2021

After succesful connection navigating to music screen on my miband4 resulted in below error:

2021-11-16 17:20:20,745 miband_api (ERROR) > 'miband' object has no attribute 'artist'
Traceback (most recent call last):
  File "/miband4/miband_api.py", line 113, in post_wait_for_notifications
    notification_received = band.waitForNotifications(0.5)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 560, in waitForNotifications
    resp = self._getResp(['ntfy','ind'], timeout)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 416, in _getResp
    self.delegate.handleNotification(hnd, data)
  File "/miband4/miband.py", line 111, in handleNotification
    self.device.setMusic()
  File "/miband4/miband.py", line 666, in setMusic
    if self.artist is not None:
AttributeError: 'miband' object has no attribute 'artist'

FYI the full log:

root@pi3two:/miband4# python miband_api.py
2021-11-16 17:19:03,940 miband_api (INFO) > Connecting to MQTT broker (nuc1:1883 alive=60, bind_address=)...
2021-11-16 17:19:03,981 miband_api (INFO) > ... connected to MQTT Broker!
2021-11-16 17:19:04,110 uvicorn.error (INFO) > Started server process [1923]
2021-11-16 17:19:04,111 uvicorn.error (INFO) > Waiting for application startup.
2021-11-16 17:19:04,113 uvicorn.error (INFO) > Application startup complete.
2021-11-16 17:19:04,115 uvicorn.error (INFO) > Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)
2021-11-16 17:19:12,021 uvicorn.access (INFO) > 192.168.2.40:50097 - "GET /docs HTTP/1.1" 200
2021-11-16 17:19:12,396 uvicorn.access (INFO) > 192.168.2.40:50097 - "GET /openapi.json HTTP/1.1" 200
2021-11-16 17:19:38,988 miband (INFO) > Connecting to D1:C5:15:51:03:89
2021-11-16 17:19:40,190 miband (INFO) > Connected
2021-11-16 17:19:46,099 miband (INFO) > Enabling Auth Service notifications status...
2021-11-16 17:19:46,225 miband (INFO) > Requesting random number...
2021-11-16 17:19:46,246 miband (INFO) > Sending encrypted random number
2021-11-16 17:19:46,375 miband (INFO) > Initialized
2021-11-16 17:19:46,376 miband (INFO) > Disabling Auth Service notifications status...
2021-11-16 17:19:46,412 uvicorn.access (INFO) > 192.168.2.40:50098 - "POST /connect?mac_address=D1%3AC5%3A15%3A51%3A03%3A89&authentication_key=1cf7c5612b4791be375f1b02b7f3ac7b HTTP/1.1" 200
2021-11-16 17:20:13,964 miband_api (INFO) > Waiting for notifications - infinite loop - never returning !
2021-11-16 17:20:20,745 miband_api (ERROR) > 'miband' object has no attribute 'artist'
Traceback (most recent call last):
  File "/miband4/miband_api.py", line 113, in post_wait_for_notifications
    notification_received = band.waitForNotifications(0.5)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 560, in waitForNotifications
    resp = self._getResp(['ntfy','ind'], timeout)
  File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 416, in _getResp
    self.delegate.handleNotification(hnd, data)
  File "/miband4/miband.py", line 111, in handleNotification
    self.device.setMusic()
  File "/miband4/miband.py", line 666, in setMusic
    if self.artist is not None:
AttributeError: 'miband' object has no attribute 'artist'
2021-11-16 17:20:25,861 miband_api (INFO) > music focus out
@janvda
Copy link
Owner Author

janvda commented Nov 16, 2021

I have also reported this issue in master repository with solution: satcar77#54

@janvda
Copy link
Owner Author

janvda commented Nov 16, 2021

fixed by commit 204ca92

@janvda janvda closed this as completed Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant