Skip to content

Commit

Permalink
Matonomo event for Restart after communication error
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Dec 30, 2024
1 parent 70dbc71 commit b7bd513
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Modules/matomo_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ def matomo_coordinator_initialisation(self):
send_matomo_request( self, action_name="Coordinator Action", event_category="Coordinator", event_action="NewNetwork", event_name="Coordinator Formed new network" )


def matomo_coordinator_restart_after_error(self):
send_matomo_request( self, action_name="Coordinator Action", event_category="Coordinator", event_action="RestartAfterError", event_name="Coordinator Restart after commmunication error" )


def matomo_plugin_shutdown(self):
send_matomo_request( self, action_name="Plugin Action", event_category="Plugin", event_action="Shutdown", event_name="Plugin Shutdown" )

Expand Down
4 changes: 2 additions & 2 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
from Modules.heartbeat import processListOfDevices
from Modules.input import zigbee_receive_message
from Modules.matomo_request import (matomo_coordinator_initialisation,
matomo_coordinator_restart_after_error,
matomo_plugin_analytics_infos,
matomo_plugin_restart,
matomo_plugin_shutdown,
matomo_plugin_started)
from Modules.paramDevice import initialize_device_settings
Expand Down Expand Up @@ -802,7 +802,7 @@ def restart_plugin(self):
self.log.logging("Plugin", "Error", error_message)
self.adminWidgets.updateNotificationWidget(Devices, error_message)
if self.internet_available and self.pluginconf.pluginConf["MatomoOptIn"]:
matomo_plugin_restart(self)
matomo_coordinator_restart_after_error(self)

restartPluginViaDomoticzJsonApi(self, stop=False, url_base_api=Parameters["Mode5"])

Expand Down

0 comments on commit b7bd513

Please sign in to comment.