HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
20 stars 4 forks source link

Plugin HsEvent is not raised at the end of a backup operation #323

Open avargaskun opened 1 year ago

avargaskun commented 1 year ago

Environment

HomeSeer

OS

Windows and Linux

HS Version

v4.2.16.0

Development

PSDK Version

v1.4.0

Language

C#

IDE

VSCode

Dev OS

Mac

Plugin

HSBuddy

Problem

HomeSeer is not raising an event to AbstractPlugin.HsEvent when a backup ends, only when a backup starts.

Description

Looking at the implementation of HSCore.BackupManager.BackupConfigProc (in HSCore.dll):

Expected Behavior

  1. AbtractPlugin.HsEvent(HSEvent.BACKUP, eBackupChangeEvent.STARTED)is invoked when the backup starts.
  2. AbstractPlugin.HsEvent(HSEvent.BACKUP, eBackupChangeEvent.ENDED) is invoked when the backup ends.

Actual Behavior

  1. AbtractPlugin.HsEvent(HSEvent.BACKUP, eBackupChangeEvent.STARTED)is invoked when the backup starts.
  2. AbstractPlugin.HsEvent(HSEvent.BACKUP, eBackupChangeEvent.ENDED) is NOT invoked when the backup ends.

Steps to Reproduce

  1. From an HS4 plugin, register for the backup events using: IHsController.RegisterEventCB(HSEvent.BACKUP, "HSBuddy")
  2. In the plugin class, implement the AbstractPlugin.HsEvent() method and log every call with its parameters
  3. Perform a local backup of the HS controller from the web UI (Tools > Backup/Restore)

Screenshots

NA

Logs

NA

spudwebb commented 1 year ago

Tracked as HS-1761

sjhill01 commented 1 year ago

When you work on this, the documentation needs updating, too, since it references constants that don't align with what's actually in the SDK.

avargaskun commented 1 year ago

Hey! Just a quick ping. Any chance this could be included in an upcoming HS release?