maploader icon indicating copy to clipboard operation
maploader copied to clipboard

Add ability to load/save specified map

Open darsor opened this issue 3 years ago • 2 comments

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.

darsor avatar Aug 25 '22 04:08 darsor

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.

pkoehlers avatar Sep 01 '22 19:09 pkoehlers

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

pkoehlers avatar Sep 04 '22 22:09 pkoehlers

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.

darsor avatar Dec 06 '22 03:12 darsor

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

MarkyMarkNL avatar Feb 10 '23 15:02 MarkyMarkNL

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.

maploader-load-save-map.zip

louis-lau avatar Mar 03 '23 20:03 louis-lau

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

mo5h avatar Mar 30 '23 06:03 mo5h

I'd appreciate a merge ASAP.

Thank you for the maploader, great stuff.

corbolais avatar Jul 09 '23 14:07 corbolais

Thank you!

corbolais avatar Jul 11 '23 09:07 corbolais