python-ring-doorbell icon indicating copy to clipboard operation
python-ring-doorbell copied to clipboard

listen -- ValueError

Open justin2004 opened this issue 1 year ago • 4 comments

I got the same result running the version in pip and from the main branch of this repo.

$ python3 ring_doorbell/cli.py --version
cli.py, version 0.8.7
$ python3 ring_doorbell/cli.py list
---------------------------------
Ring CLI
Front Door (doorbell_v4)

$ python3 ring_doorbell/cli.py listen
---------------------------------
Ring CLI
INFO:firebase_messaging.fcmpushclient:Registered with FCM
New push credentials created:
INFO:firebase_messaging.fcmpushclient:Succesfully logged in to MCS endpoint
Listening, press enter to cancel

# << i walked to the front door to active the device >>

 ERROR:firebase_messaging.fcmpushclient:Unexpected exception calling notification callback
Traceback (most recent call last):
  File "/home/justin/.local/lib/python3.10/site-packages/firebase_messaging/fcmpushclient.py", line 428, in _handle_data_message
    callback(ret_val, msg.persistent_id, obj)
  File "/home/justin/.local/lib/python3.10/site-packages/ring_doorbell/listen/eventlistener.py", line 181, in on_notification
    datetime.strptime(created_at, "%Y-%m-%dT%H:%M:%S.%f%z")
  File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2024-02-10T14:24:53Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'

justin2004 avatar Feb 10 '24 14:02 justin2004

I’ll look into this. Where are you based and do you know what firmware version you are running?

sdb9696 avatar Feb 10 '24 17:02 sdb9696

thanks @sdb9696 . I've got a Ring Video Doorbell 2. Radio-related software "14.0.25"

I am in Missouri.

justin2004 avatar Feb 10 '24 22:02 justin2004

I'm seeing the same in NYC running 0.7.7 of the lib, it looks like the issue lies in the timestamp coming back from firebase

AndrewMohawk avatar Apr 22 '24 20:04 AndrewMohawk

I've made a small patch that works-for-me(tm) on 0.7.7 and applied it to the latest (I couldnt find how to do it to the older releases), but you should be able to copy/paste the changes as the code is the same!

https://github.com/tchellomello/python-ring-doorbell/pull/378

@justin2004 / @sdb9696

AndrewMohawk avatar Apr 22 '24 21:04 AndrewMohawk

There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs. Please make sure to update to the latest ring_doorbell version and check if that solves the issue. Thank you for your contributions.

github-actions[bot] avatar Jul 22 '24 00:07 github-actions[bot]

This should now be fixed in the master branch with https://github.com/tchellomello/python-ring-doorbell/pull/378. Will hopefully get round to doing a release over the next few days.

sdb9696 avatar Aug 08 '24 10:08 sdb9696