Add ability to load/save specified map
This is my attempt at implementing the ability to load/save specified maps via MQTT.
It adds new valetudo/maploader/map/load and valetudo/maploader/map/save topics which accept a string payload containing the map name to operate on. An empty map name operates on the current map.
This hasn't been fully tested yet, but I wanted to get the pull request in to get feedback. Needs to be tested, and documentation added, before merging.
Some code cleanup (fixed typos, removed old/unused functions) was also done.
Thank you for the PR, I checked your code and it's looking great.
Load and save should be working fine and I also like all the smaller improvements.
I have triggered the GitHub Actions build and installed the binary on my robot, so that I can do some testing over the next few days.
I found another small bug in the rotation that I would fix after this PR is merged. (line 138 "tar" -> "tar.gz")
Apart from that, it's working great with the small fix that I started the review on
I fixed the bug you mentioned, and another missed ".gz" as well that was causing problems. It's working for me, so I think it's ready to merge. This would close issue #11.
Any chance of merging this into a new release. (and explaining how to call this from HA? Would love to have the functionality. For now have figured out I can do this from SSH to restore backup:
rm -r /data/ri rm -r /data/DivideMap rm -r /data/map cd /data/maploader tar -xvf backup-main.tar -C / reboot
For anyone that just wants to start using this quickly before the next release, and is willing to trust compiled binaries from strangers on the internet, here they are. I just uitilized the github action that already exists, as I don't know a lot about golang.
For anyone paranoid, and as such doesn't trust compiled binaries from strangers on the internet, I created a quick fork for the purposes of triggering the github action to compile it, here's the build with the artifacts here: https://github.com/mo5h/maploader/actions/runs/4561428914
I'd appreciate a merge ASAP.
Thank you for the maploader, great stuff.
Thank you!