python-ring-doorbell
python-ring-doorbell copied to clipboard
Check_alerts() function not working
Hopefully I'm just doing it wrong, but the check_alerts() function for the doorbell is not working for me
I have set up a ~7s loop, to check that function and get the alert details when one happens
from ring_doorbell import Ring
from ring_doorbell import RingDoorBell
from pprint import pprint
import time
myring = Ring('creds', "False", 'True','http://localhost/', 'True', 'ring_doorbell-session.cache')
while(True):
obj2 = RingDoorBell(myring, 'Front Door')
checker = obj2.check_alerts()
print checker
print obj2.battery_life
time.sleep(2)
This runs and continues to print None and the battery life, after creating a motion event while this loop is running i get nothing
this works for me, but what it does is simply tell u if a Ding or a Motion event was triggered last.. Checkout my code https://github.com/asantaga/alexashowRing/blob/master/alexaringdoor.py
Thanks @asantaga looks like its just me then! I'll grab that snippet out of your code base there and try that
Please @mrwhale let us know if that worked.
Yeah so it seems that class doesn't like the check_alerts() method
from ring_doorbell import Ring
from ring_doorbell import RingDoorBell
myring = Ring('creds', "False", 'True','http://localhost/', 'True', 'ring_doorbell-session.cache')
while(True):
print RingDoorBell(myring, 'Front Door').check_alerts()
print myring.doorbells[1].check_alerts()
When an event happens ( A ring event in this case) i got
None
True
So it seems myring.doorbells[1].check_alerts() works but RingDoorBell(myring, 'Front Door').check_alerts() does not
@mrwhale you may want to use return instead of print this may be causing your output to be none
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.