Skip to content

Conversation

@agners
Copy link
Member

@agners agners commented Aug 4, 2025

Breaking change

Proposed change

Remove eMMC specific calculations and references in the disk life time handling to generalize the code for all disk types. This includes updating translations and UI components to reflect a more generic approach to disk life time metrics.

This is required since Supervisor returns life time estimates for NVMe SSD's with home-assistant/supervisor#6056.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Remove eMMC specific calculations and references in the disk life
time handling to generalize the code for all disk types. This includes
updating translations and UI components to reflect a more generic
approach to disk life time metrics.
The previous code tried to estimate based on disk type, 30 MB/s for
eMMC devices and 10 MB/s for others. However, this did not work
correctly since the disk_life_time returns null for non-eMMC devices,
leading to 30 MB/s being used for all devices.

Now disk_life_time is not a eMMC indicator anymore. Simply assume a
constant speed of 30 MB/s for all disk operations explicitly.
const speed = supervisor.host.disk_life_time !== "" ? 30 : 10;
const moveTime = (supervisor.host.disk_used * 1000) / 60 / speed;
// Assume a speed of 30 MB/s.
const moveTime = (supervisor.host.disk_used * 1000) / 60 / 30;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this is using the disk_life_time estimate as indication of if this is an eMMC (and with that an estimated disk speed).

From what I can tell the Supervisor API always returned null if there was no eMMC disk life time used estimate available (see home-assistant/supervisor#2413).

Anyhow, since most folks use faster storage nowadays, 30MB/s seems like a reasonable general estimate today.

So essentially, this code defaulted to 30MB/s anyways.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean it is, and was, wrong for eMMC storage?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what the speed intention was, I guess eMMC was considered faster then SD card. But since null (non-eMMC) and a number (eMMC) evaluated to true, the "SD card" (or rather non-eMMC) case was broken.

@agners agners merged commit 92cf8b5 into dev Aug 5, 2025
15 checks passed
@agners agners deleted the remove-emmc-handling-in-disk-life-time-used branch August 5, 2025 08:42
@agners agners added this to the 2025.8 milestone Aug 5, 2025
bramkragten pushed a commit that referenced this pull request Aug 5, 2025
* Remove eMMC specific references in disk life time handling

Remove eMMC specific calculations and references in the disk life
time handling to generalize the code for all disk types. This includes
updating translations and UI components to reflect a more generic
approach to disk life time metrics.

* Assume 30 MB/s as the speed for disk operations

The previous code tried to estimate based on disk type, 30 MB/s for
eMMC devices and 10 MB/s for others. However, this did not work
correctly since the disk_life_time returns null for non-eMMC devices,
leading to 30 MB/s being used for all devices.

Now disk_life_time is not a eMMC indicator anymore. Simply assume a
constant speed of 30 MB/s for all disk operations explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked cla-signed Supervisor Related to the supervisor panel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants