Previously when the error state was set for a sensor we would clear the old
state and set the new one, without checking if they were the same. But this
would result in a closing of the existing notification and showing of a new one
with the same contents.
In general it can be useful to let the user know that the sensor has encountered
and error BUT we don't want to do this every time the sensor value is tried to
be read. So check if the new error condition is different and only then take any
action, that way we won't close and redisplay the same notification.
snap: fix local builds to properly rebuild on changes
If we set source-type as git then snapcraft won't detect local changes - instead
unset this so it propagates any changes to the container build environment.
Previously both the default alarm timeout and the sensor poll timeout were set
to 5 seconds and so there was no chance for the sensor value to be updated
before the alarm notification would be displayed - but then once it was
displayed the value could then have got updated to now be below the threshold,
and so the user would see a notification that was unexpectedly below the
configured threshold.
So fix this by setting the sensor poll timeout to 4 seconds, and fixing the
hysteresis value at 5 seconds so that there is a chance to update the sensor
value before the alarm notification is shown.
Also remove the ability to configure the hysteresis value as users will not need
to configure this anyway.
indicator-sensors/is-sensor-dialog.c: Fix crash in sensors properties
Ensure we disconnect our signal handlers on our sensor when getting disposed
otherwise when the properties of that sensor change again in the future, our
signal handlers will still get called with a dangling pointer and hence this may
cause a crash.