HomeSeer/Plugin-SDK

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

avargaskun opened this issue · 3 comments

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):

  • BackupConfigChangeEvent(Enums.eBackupChangeEvent.STARTED) is called at the beginning of the backup operation
  • However, BackupConfigChangeEvent(Enums.eBackupChangeEvent.ENDED) is never called

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

Tracked as HS-1761

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.

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