Telegram_bot: allow passing of io.BytesIO instead of only url and filepath

Hi,

I am trying to send a picture from appdaemon using telegram.

The telegram integration accepts “url” and “filepath”, but home assistant and appdaemon are in different docker containers and I create the picture dynamically (matplotlib graph), so I can use neither filepath nor url.

Please consider adding an option (e.g. “data”) that accepts io.BytesIO so that users can pass through data.

As a workaround, you could also just mount a folder to both containers so that appdaemon can write the file and Home Assistant can read it.

That’s an ok woraround, but it’d be much nicer to be able to just send a io.ByteIO object.

Because in a year or so when I upgrade to another machine I’ll have forgotten about the hoops I had to jump through to set permissions (ad uses a non-root user).

1 Like