mqtt_vacuum_camera: migration broken since last release

Checklist

  • I have updated the integration to the latest version available
  • I have checked if the problem is already reported

The problem

Since updating to the lastest version homeassistant shows a migration error.

here is the relevant log:

Traceback (most recent call last):
  File "/nix/store/7z97x7nvmr0kpssp9xa3j058x4nmgx3f-homeassistant-2024.3.3/lib/python3.12/site-packages/homeassistant/config_entries.py", line 770, in async_migrate
    result = await component.async_migrate_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/hass/custom_components/valetudo_vacuum_camera/__init__.py", line 211, in async_migrate_entry
    await move_data_to_valetudo_camera()
  File "/var/lib/hass/custom_components/valetudo_vacuum_camera/__init__.py", line 305, in move_data_to_valetudo_camera
    os.makedirs(valetudo_camera_folder)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 225, in makedirs
OSError: [Errno 30] Read-only file system: '/.storage'

it seems that it tries to write to /.storage (which doesn’t exist) my homeassistant storage dir lives in /var/lib/hass/.storage all the other plugins and homeassistant itself uses the correct storage dir.

What version of an integration has described problem?

2024.04.1

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

two dreames

Please firmware installed on your Vacuum.

valtudo

What type of platform you use?

Intel NUC (or generic x86_64)

What version of Home Assistant do you use?

2024.4.0

What type of installation are you running?

Home Assistant Core

Camera’s settings.

No response

Logs or Errors shown in the HA snapshots (please enable the Debug Mode)

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I figure out that the issue might be caused from os.path.join.

 storage_folder = os.path.join(os.getcwd(), STORAGE_DIR) 
 valetudo_camera_folder = os.path.join(storage_folder, "valetudo_camera")

this lines 300 and 301 in init.py need to be replaced with:

 storage_folder = f"{os.getcwd()}/{STORAGE_DIR}"
 valetudo_camera_folder = f"{storage_folder}/valetudo_camera"

can you give it a try and let me know if it works on yours @carefulcomputer and @ChrisOboe configs? alternatively you can download the main where I did modify those lines just few minutes ago #1a3e387