Skip to content

Commit

Permalink
Hard reset Z-Wave module on Z/IP Gateway exit (#888)
Browse files Browse the repository at this point in the history
If a reset function is provided in Grizzly's startup options, reset the
Z-Wave module when Z/IP Gateway exits to try to resolve cases where the
module has locked up.
  • Loading branch information
bjyoungblood authored Jan 26, 2024
1 parent 65c72fd commit db18d68
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/grizzly/zipgateway/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ defmodule Grizzly.ZIPGateway.Supervisor do
%{exit_status: status}
)

grizzly_opts = Grizzly.options()
reset_zwave_module(grizzly_opts)

:error_exit_status
end

@spec reset_zwave_module(Options.t()) :: :ok
defp reset_zwave_module(%Options{zwave_firmware: opts}) do
if is_function(opts[:module_reset_fun], 0), do: opts.module_reset_fun.()

:ok
end
end

0 comments on commit db18d68

Please sign in to comment.