Closed jeremysherriff closed 4 months ago
Showing the packages available as attributes could cause issues because it would constantly change, so Home Assistant will populate it's database with a lot of entries. A workaround would be to create this sensor and have it disabled as a default, so the user will have to enable it manually.
An additional, disabled-by-default sensor with update count as the state and an attribute with the package names would be perfect.
I was originally going to request that attribute values were made part of the expose
bash commands as part of #111 but I think your idea here is better.
The documentation should include a small warning about HA database bloat though, you are right to be concerned about that.
I've created this sensor that includes the number of packages and as attributes, includes all available packages that need to be updated. By default this is disabled and I've also mentioned on the Documentation about the issue with the attributes on the Database of Home Assistant.
These updates look really good, thank you for your efforts on these.
Describe the solution you'd like
I would like to be able to see detail information of the updates available, for the System Updates sensor. Ideally;
Alternatively, exposing the count of packages as a separate Sensor would be equally useful, with the pagckages as an attribute of that new sensor.
Additional context
For Ubuntu, I see that the System Updates sensor is triggered by
apt list --upgradable | wc -l
being parsed aslargerthan 2
. If the output ofapt list --upgradable | grep -v 'Listing...'
was grabbed instead (eg as variableRAW
), and then parsed in different ways:Binary sensor =
echo $RAW | wc -l
largerthan 0Attribute: Count of updates =
echo $RAW | wc -l
Attribute: Packages =
echo $RAW | awk -F '/' '{print $1}'