travisghansen / hass-opnsense

OPNsense integration with Home Assistant
194 stars 25 forks source link

differentiate needs_reboot from upgrade_needs_reboot #133

Closed penguintamer closed 5 months ago

penguintamer commented 6 months ago

fixes #101

I just tested this with a 24.1.2 -> 24.1.3 opnsense update on my router, with home-assistant 2024.2.5. It told me that it didn't require a reboot.

alexdelprete commented 6 months ago

@penguintamer Thanks. Did you check opnsense source to come up with this? do you have a pointer so I can take a look at it? Thanks.

penguintamer commented 6 months ago

Other than poking around the code near what I linked in #101, this section of the API code pretty clearly shows how the update/upgrade needs_reboot/upgrade_needs_reboot types fit together.

                if (
                    ($active_status == 'update' && $response['needs_reboot'] == 1) ||
                    ($active_status == 'upgrade' && $response['upgrade_needs_reboot'] == 1)
                ) {
                    $active_reboot = '1';
                    $response['status_msg'] = sprintf(
                        '%s %s',
                        $response['status_msg'],
                        gettext('This update requires a reboot.')
                    );
                }
alexdelprete commented 6 months ago

this section of the API code pretty clearly shows how the update/upgrade needs_reboot/upgrade_needs_reboot types fit together.

Thanks for the explanation, and I agree with you, that API section is pretty clear.

@travisghansen LGTM now that I saw the relevant API section.