-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remove eMMC specific references in disk life time handling #26379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
* 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.
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
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: