custom-components/breaking_changes

set scan_interval and add attributes installed version/available version

Mariusthvdb opened this issue · 13 comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

the sensor shows updates each minute (while the user isn't aware of a sensor: version to be configured. moreover it uses PyPi as source, which in my setting wasn't used (I use local and Hassio).

Added to that, using the breaking_changes intergration, together with the version: sensors cause unnecessary updates and while the version sensor is set to update each 5 minutes, breaking changes updates each minute. See below for the result in the log.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Would be really nice to be able to set scan_interval (twice a day would be frequent enough for my settings, others might even use less frequent, some maybe each hour...as always ymmv)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

adding the attributes 'available' and 'installed', which the breaking changes sensor must use in the first place, could allow the user not to use the version: sensor, and cut down on checks even further

Additional context
Add any other context or screenshots about the feature request here.

please see: https://community.home-assistant.io/t/version-is-sensor-pypi-shown-without-being-configured-why/124689

and the log, which loops this of course:

2019-07-03 15:37:26 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Hassio', 'beta': False, 'board': 'rpi3', 'image': 'raspberrypi3', 'hassos': '2.12', 'supervisor': '167', 'hassos-cli': '9'}
2019-07-03 15:38:21 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:38:21 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Local'}
2019-07-03 15:38:21 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:38:21 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'PyPi', 'beta': False}
2019-07-03 15:39:24 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:39:24 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Local'}
2019-07-03 15:39:24 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:39:24 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'PyPi', 'beta': False}
2019-07-03 15:40:29 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:40:29 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Local'}
2019-07-03 15:40:29 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:40:29 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'PyPi', 'beta': False}
2019-07-03 15:41:33 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:41:33 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Local'}
2019-07-03 15:41:33 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:41:33 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'PyPi', 'beta': False}
2019-07-03 15:42:35 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:42:35 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Local'}
2019-07-03 15:42:36 DEBUG (MainThread) [pyhaversion] Version: 0.95.4
2019-07-03 15:42:36 DEBUG (MainThread) [pyhaversion] Version data: {'source': 'Hassio', 'beta': False, 'board': 'rpi3', 'image': 'raspberrypi3', 'hassos': '2.12', 'supervisor': '167', 'hassos-cli': '9'}

setup:

sensor:
  - platform: version
    name: HA installed version

  - platform: version
    name: HA available version
#    beta: true
    image: raspberrypi3
    source: hassio

next to integration:
breaking_changes:

thanks for considering

I'll have a look.

This does not use or configure sensor.version but uses the same library.

sure, aware of that.
As just confirmed: taking the integration breaking_changes out, makes the sensor: version show up each 5 minutes. As per design.

making breaking_changes is the cause the per minute update of sensor: version, both showing PyPi as source, and Local.
Hope you can fix this in the integration.
Other option would maybe be to check first if the system already uses the sensor: version, and if yes, use that, and not use a check to PyPi by itself?

As just confirmed: taking the integration breaking_changes out, makes the sensor: version show up each 5 minutes. As per design.

No... it is not that sensor you are seeing logging for, it is from the library pyhaversion.

The reason PyPi is used, is that one is first updated when there is a release.

ok sorry, worded it incorrectly.
let me just show what is looks like without breaking_changes:

Schermafbeelding 2019-07-04 om 07 06 50

sensor: version shows as it should, each 5 minutes, for both setup checks.

with breaking_changes , it shows as posted in top issue posting.

No... That is not sensor.version....

This integration does not change how that sensor (or any sensor) operate.

well, what can I say. It does. in my setup.

without integration breaking_changes the log shows:
Schermafbeelding 2019-07-04 om 08 11 56

with integration breaking_changes:

Schermafbeelding 2019-07-04 om 07 57 26

And that is not a home assistant sensor that is creating those logs, that is a python library.

and it is caused by the integration breaking changes...
have tested 2 extra scenarios:

only breaking_changes installed:

Schermafbeelding 2019-07-04 om 08 39 24

none installed:
nothing showing in the log, so we can be certain no other integration is at the root of this.

I'm done with this discussing, you are not getting what I'm saying to you.
If you don't like how it works, don't use it.

I will look into adding a scan_interval option, but I'm not making any promises.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

thanks for the scan_interval!

tried it as follows:

# https://github.com/custom-components/breaking_changes
breaking_changes:
  scan_interval: 3600

to have it update every hour. Unfortunately it still fires every minute:

Schermafbeelding 2019-07-23 om 10 06 35