joseffallman / hass_flashforge

FlashForge 3D printer integration for Home Assistant
MIT License
8 stars 2 forks source link

add services and buttons to control the printer remotely #43

Closed yohaybn closed 5 months ago

yohaybn commented 5 months ago

add new services for abort, print and stop the printer. also add service to get the files that stored on printer for remote printing

Added new buttons and select entity

joseffallman commented 5 months ago

Nice work!

Some quick thoughts.

Thanks a lot for this pr, really great to have the functionality in HA.

yohaybn commented 5 months ago

Hi. I fixed it... can you take a look? thank you for your awesome work with library and this integration!

joseffallman commented 5 months ago

I made some changes, mostly linting. But also, moved mac an serial to device info instead of separate sensors. And created a separate FilePrinterButton class. It's ridiculous hard to get from a unique id to the state of that entity :)

Noticed that the file selector is only updated on home assistant restarts. And that's not so good. Could we use the FlashForgeDataUpdateCoordinator some how to query the printer about files and do the updates?

(Apologize if I force pushed but did a rebase to catch up)

//Josef

yohaybn commented 5 months ago

I added method to select entity that update the list. I don't know if this method called automatically but when you call to homeassistant.update_entity service the list updated.