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: 'Ring' object has no attribute 'stickup_cams' #188

Closed
dlemmink opened this issue Jan 18, 2020 · 4 comments
Closed

AttributeError: 'Ring' object has no attribute 'stickup_cams' #188

dlemmink opened this issue Jan 18, 2020 · 4 comments

Comments

@dlemmink
Copy link

Using 0.6.0 and Python 3.6.9 I get the error AttributeError: 'Ring' object has no attribute 'stickup_cams'
when issuing the following code:

def main():
if cache_file.is_file():
auth = Auth(
"HomeAssistant/0.105.0dev0",
json.loads(cache_file.read_text()),
token_updated,
)
else:
username = ''
password = '
'
auth = Auth(None,None)
try:
auth.fetch_token(username, password)
except MissingTokenError:
auth.fetch_token(username, password, otp_callback())
#pprint(auth.token_updater)

ring = Ring(auth)
ring.update_data()
pprint(ring.devices())
 for dev in ring.stickup_cams:

    # refresh data
    dev.update_health_data()

    print('Account ID: %s' % dev.account_id)
    print('Address:    %s' % dev.address)
    print('Family:     %s' % dev.family)
    print('ID:         %s' % dev.id)
    print('Name:       %s' % dev.name)
    print('Timezone:   %s' % dev.timezone)
    print('Wifi Name:  %s' % dev.wifi_name)
    print('Wifi RSSI:  %s' % dev.wifi_signal_strength)


Output is as follows:

{'authorized_doorbots': [<RingDoorBell: Warehouse Door>,<RingDoorBell: Office Front Door>],
'chimes': [<RingChime: Downstairs>, <RingChime: Bedroom Chime>],
'doorbots': [<RingDoorBell: Front Door>],
'stickup_cams': [<RingStickUpCam: Front>,<RingStickUpCam: Garage>,RingStickUpCam:Parking]}
Traceback (most recent call last):
File "test.py", line 63, in
main()
File "test.py", line 44, in main
for dev in ring.stickup_cams:
AttributeError: 'Ring' object has no attribute 'stickup_cams'

I was able to authenticate earlier but couldn't get_snapshots.
Now I can't retrieve anything from the cameras

@dmurphynj
Copy link

Having the same issue ... Got the authentication working ok (thank you!!) but now I can't seem to find the stickup_cams attribute ...

pprint(myring.devices())

for dev in list(myring.stickup_cams + myring.chimes + myring.doorbells):  
	dev.update_health_data()
	if dev.family == 'stickup_cams' and dev.lights:
		dev.lights = 'off'

returns the following:

{'authorized_doorbots': [],
 'chimes': [],
 'doorbots': [],
 'stickup_cams': [<RingStickUpCam: Backyard>]}
Traceback (most recent call last):
  File "./ringoff.py", line 40, in <module>
    for dev in list(myring.stickup_cams + myring.chimes + myring.doorbells):  
AttributeError: 'Ring' object has no attribute 'stickup_cams'

@steve-gombos
Copy link
Collaborator

Yeah see the updated documentation in my PR or below.

devices = myring.devices()
for dev in list(devices['stickup_cams'] + devices['chimes'] + devices['doorbots']):  
	dev.update_health_data()
	if dev.family == 'stickup_cams' and dev.lights:
		dev.lights = 'off'

@dmurphynj
Copy link

That's a work of art! Thanks Steve! Works like a champ.

@dlemmink
Copy link
Author

Awesome...Thanks. Looks like the documentation wasn't up to date.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants