-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Show Number Of Available Updates via APT #71
Comments
While non-ubuntu Debian distros don't have the update notifier as they don't distinguish between security updates and others there is a simple means to ask the packaging system what updates are available. I'll put this in as a slow poll (maybe update the values every 4 hours?) and then push the count of packages needing an update. So this will be a single count, not two counts. Sound ok? |
Sure, I just need to be able to look at the info in Home Assistant and see which rPi devices need an |
Well, this is problematic as getting this info so far required root access. I don't want to have us all give the Daemon account root access... so I need to find another way. One thought I have is to provide a script that gets this data and deposits it as a tiny text file. The user can then set up this script to run under Also, the user would run this script as part of the update run as well:
oh.. and the tiny script appears to be:
(well there's probably more filtering on the output to reduce to only that which is useful but you get what I'm doing) Thoughts? |
Personally I'd prefer the setup to be as simple as possible without installing extra bits. The code snippet I provided would cover my needs. However, I appreicate that you want this to be functional for as many systems as possible. So, perhaps I'm not the best person to comment. Since, you already grab the OS info would it be an option to automatically deploy the python example I gave but prompt users of other OS's to add the extra script if their OS / system is detected as being none RPi ? |
If this does go ahead, make it an opt in setting.
I really don't wish my Pi's to be connecting to apt repositories to see if
there are any updates, not only does it take resources from whatever it is
doing but also takes time to update each repository. It may well be a low
power device etc.
If I was to do this, I'd spin it out as a separate project and have its own
program reporting to HA under its own entity.
I don't know if the RPi update/updates section in HA can be used for that.?
Even then every month or at most a week or so would be best.
Just my input.
…On Sun, 19 Feb 2023, 5:36 pm Phill Healey, ***@***.***> wrote:
Personally I'd prefer the setup to be as simple as possible without
installing extra bits. The code snippet I provided would cover my needs.
However, I appreicate that you want this to be functional for as many
systems as possible. So, perhaps I'm not the best person to comment.
Since, you already grab the OS info would it be an option to automatically
deploy the python example I gave but prompt users of other OS's to add the
extra script if their OS / system is detected as being none RPi ?
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYAXN33B4ZHXXOCEO3JCMDWYJKYFANCNFSM6AAAAAAUJAUEPQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
I was a contributer to a project very similar to this one that was abandoned about a year ago. In that project we used the python script given in my first post and there were no reported issues from any users regarding this particular function. I had it running on several different RPi devices including a couple of the original RPi Zeros. The script literally only needs to be called once per week or even monthly. It's just to give you a heads-up that updates are available for the device. Any impact is negligable in my experience. |
@codeclinic Jeez... I completely missed the fact the you have the small snippet of code at the head of this issue. I'm trying it out and and will push a set of releases (Daemon, card) when I get it all understood and implemented. More soon. |
I'm not against it, all for it in fact, just make it opt in. :-)
All the opt in is done in the setting file at the start with all the other
parts you have to setup.
It was also the every four hours mentioned, the few weeks/month as above I
agree with.
It needs to be it's own entity, not hidden in an attribute again. They're
stupid things and make it harder to organise and trigger on in HA, not
everyone uses the card.
…On Sun, 19 Feb 2023, 10:21 pm Phill Healey, ***@***.***> wrote:
I really don't wish my Pi's to be connecting to apt repositories to see if
there are any updates, not only does it take resources from whatever it is
doing but also takes time to update each repository. It may well be a low
power device etc.
I was a contributer to a project very similar to this one that was
abandoned about a year ago. In that project we used the python script given
in my first post and there were no reported issues from any users regarding
this particular function. I had it running on several different RPi devices
including a couple of the original RPi Zeros.
The script literally only needs to be called once per week or even
monthly. It's just to give you a heads-up that updates are available for
the device. Any impact is negligable in my experience.
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYAXN47SKJ3QDERRKZTEULWYKMFNANCNFSM6AAAAAAUJAUEPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
No, problem. I thought you were saying you wanted a universally implementable option and so my suggestion wouldn't work. ;-) |
ok, will appear in next release! |
Excellent! |
Changes committed and now avail. in v1.8.0 and later. |
Is your feature request related to a problem? Please describe.
It would be great if this library could also show the number of available system updates on a system.
Describe the solution you'd like
The MQTT message should include the number of available system (apt) updates, so that it can be displayed in Home Assistant.
Describe alternatives you've considered
This info can be grabbed in python using the following code:
import apt
cache = apt.Cache()
cache.open(None)
cache.upgrade()
return str(cache.get_changes().len())
Additional context
The solution given above should work in this project. It would just need to be added to the posted MQTT message(s) for retrieval in Home Assistant
The text was updated successfully, but these errors were encountered: