Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

push_file gives AttributeError #179

Open
nonfatalexec opened this issue Apr 18, 2022 · 0 comments
Open

push_file gives AttributeError #179

nonfatalexec opened this issue Apr 18, 2022 · 0 comments

Comments

@nonfatalexec
Copy link

I'm getting an AttributeError for the attribute "device_iden" when I use push_file. There's no issues when I use push_note. See code and error output below.

pb = Pushbullet(apiKey)
with open("image_path.jpg", "rb") as img:
            file_data = pb.upload_file(img, "image.jpg")

for chat in pb.chats:
            if str(chat) == "Chat('My Name <myemail>)":
                push = chat.push_note("Title", "some text")
                push = chat.push_file(**file_data)
>>> push = chat.push_file(**file_data)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gerald/.local/lib/python3.10/site-packages/pushbullet/device.py", line 29, in push_file
    return self._account.push_file(file_name, file_url, file_type, body=body, title=title, device=self)
  File "/home/gerald/.local/lib/python3.10/site-packages/pushbullet/pushbullet.py", line 256, in push_file
    data.update(Pushbullet._recipient(device, chat, email, channel))
  File "/home/gerald/.local/lib/python3.10/site-packages/pushbullet/pushbullet.py", line 106, in _recipient
    data["device_iden"] = device.device_iden
AttributeError: 'Chat' object has no attribute 'device_iden'
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

1 participant